• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef UI_V2_SRC_VIEW_PRIVATE_H_
6 #define UI_V2_SRC_VIEW_PRIVATE_H_
7 
8 #include "base/observer_list.h"
9 #include "ui/v2/public/view.h"
10 
11 namespace gfx {
12 class Rect;
13 }
14 
15 namespace v2 {
16 
17 class ViewObserver;
18 
19 // Friend of View. Provides a way to access view state for the implementation
20 // of class View.
21 class ViewPrivate {
22  public:
23   explicit ViewPrivate(View* view);
24   ~ViewPrivate();
25 
observers()26   ObserverList<ViewObserver>* observers() { return &view_->observers_; }
27 
ClearParent()28   void ClearParent() { view_->parent_ = NULL; }
29 
set_bounds(const gfx::Rect & bounds)30   void set_bounds(const gfx::Rect& bounds) { view_->bounds_ = bounds; }
31 
32  private:
33   View* view_;
34 
35   DISALLOW_COPY_AND_ASSIGN(ViewPrivate);
36 };
37 
38 }  // namespace v2
39 
40 #endif  // UI_V2_SRC_VIEW_PRIVATE_H_
41