| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/shell.h" | 5 #include "ash/shell.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
| 8 #include "ui/aura/window_event_dispatcher.h" | 8 #include "ui/aura/window_event_dispatcher.h" |
| 9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
| 10 #include "ui/views/controls/button/checkbox.h" | 10 #include "ui/views/controls/button/checkbox.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // A window showing samples of commonly used widgets. | 26 // A window showing samples of commonly used widgets. |
| 27 class WidgetsWindow : public views::WidgetDelegateView { | 27 class WidgetsWindow : public views::WidgetDelegateView { |
| 28 public: | 28 public: |
| 29 WidgetsWindow(); | 29 WidgetsWindow(); |
| 30 virtual ~WidgetsWindow(); | 30 virtual ~WidgetsWindow(); |
| 31 | 31 |
| 32 // Overridden from views::View: | 32 // Overridden from views::View: |
| 33 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 33 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 34 virtual void Layout() OVERRIDE; | 34 virtual void Layout() OVERRIDE; |
| 35 virtual gfx::Size GetPreferredSize() OVERRIDE; | 35 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| 36 | 36 |
| 37 // Overridden from views::WidgetDelegate: | 37 // Overridden from views::WidgetDelegate: |
| 38 virtual views::View* GetContentsView() OVERRIDE; | 38 virtual views::View* GetContentsView() OVERRIDE; |
| 39 virtual base::string16 GetWindowTitle() const OVERRIDE; | 39 virtual base::string16 GetWindowTitle() const OVERRIDE; |
| 40 virtual bool CanResize() const OVERRIDE; | 40 virtual bool CanResize() const OVERRIDE; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 views::LabelButton* button_; | 43 views::LabelButton* button_; |
| 44 views::LabelButton* disabled_button_; | 44 views::LabelButton* disabled_button_; |
| 45 views::Checkbox* checkbox_; | 45 views::Checkbox* checkbox_; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 gfx::Rect bounds(kWindowLeft, kWindowTop, kWindowWidth, kWindowHeight); | 138 gfx::Rect bounds(kWindowLeft, kWindowTop, kWindowWidth, kWindowHeight); |
| 139 views::Widget* widget = | 139 views::Widget* widget = |
| 140 views::Widget::CreateWindowWithContextAndBounds( | 140 views::Widget::CreateWindowWithContextAndBounds( |
| 141 new WidgetsWindow, Shell::GetPrimaryRootWindow(), bounds); | 141 new WidgetsWindow, Shell::GetPrimaryRootWindow(), bounds); |
| 142 widget->GetNativeView()->SetName("WidgetsWindow"); | 142 widget->GetNativeView()->SetName("WidgetsWindow"); |
| 143 widget->Show(); | 143 widget->Show(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace shell | 146 } // namespace shell |
| 147 } // namespace ash | 147 } // namespace ash |
| OLD | NEW |