Home | History | Annotate | Download | only in oak
      1 // Copyright (c) 2012 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_OAK_OAK_WINDOW_H_
      6 #define UI_OAK_OAK_WINDOW_H_
      7 
      8 #include "ui/oak/oak_tree_model.h"
      9 #include "ui/views/controls/tree/tree_view_controller.h"
     10 #include "ui/views/widget/widget_delegate.h"
     11 
     12 namespace views {
     13 class TableView;
     14 }
     15 
     16 namespace oak {
     17 namespace internal {
     18 
     19 class OakTreeModel;
     20 class OakDetailsModel;
     21 
     22 class OakWindow : public views::WidgetDelegateView,
     23                   public views::TreeViewController {
     24  public:
     25   OakWindow();
     26   virtual ~OakWindow();
     27 
     28   static views::Widget* instance;
     29 
     30   // Overridden from views::WidgetDelegateView:
     31   virtual bool CanResize() const OVERRIDE;
     32   virtual bool CanMaximize() const OVERRIDE;
     33   virtual base::string16 GetWindowTitle() const OVERRIDE;
     34   virtual views::View* GetContentsView() OVERRIDE;
     35   virtual gfx::ImageSkia GetWindowIcon() OVERRIDE;
     36   virtual bool ShouldShowWindowIcon() const OVERRIDE;
     37   virtual void DeleteDelegate() OVERRIDE;
     38 
     39  private:
     40   // Overridden from views::View:
     41   virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
     42   virtual void ViewHierarchyChanged(
     43       const ViewHierarchyChangedDetails& details) OVERRIDE;
     44   virtual void Layout() OVERRIDE;
     45 
     46   // Overridden from views::TreeViewController:
     47   virtual void OnTreeViewSelectionChanged(views::TreeView* tree) OVERRIDE;
     48 
     49   void Init();
     50 
     51   scoped_ptr<views::TreeView> tree_;
     52   scoped_ptr<TreeOfWindows> tree_model_;
     53   views::View* tree_container_;
     54 
     55   gfx::Rect separator_rect_;
     56 
     57   scoped_ptr<views::TableView> details_;
     58   scoped_ptr<OakDetailsModel> details_model_;
     59   views::View* details_container_;
     60 
     61   DISALLOW_COPY_AND_ASSIGN(OakWindow);
     62 };
     63 
     64 }  // namespace internal
     65 }  // namespace oak
     66 
     67 #endif  // UI_OAK_OAK_WINDOW_H_
     68