OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/wm/window_positioner.h" | 5 #include "ash/wm/window_positioner.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell/toplevel_window.h" | 8 #include "ash/shell/toplevel_window.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "ash/wm/window_positioner.h" | 10 #include "ash/wm/window_positioner.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 namespace { | 103 namespace { |
104 | 104 |
105 // A WidgetDelegate that returns the out of display saved bounds. | 105 // A WidgetDelegate that returns the out of display saved bounds. |
106 class OutOfDisplayDelegate : public views::WidgetDelegate { | 106 class OutOfDisplayDelegate : public views::WidgetDelegate { |
107 public: | 107 public: |
108 explicit OutOfDisplayDelegate(views::Widget* widget) : widget_(widget) {} | 108 explicit OutOfDisplayDelegate(views::Widget* widget) : widget_(widget) {} |
109 virtual ~OutOfDisplayDelegate() {} | 109 virtual ~OutOfDisplayDelegate() {} |
110 | 110 |
111 // Overridden from WidgetDelegate: | 111 // Overridden from WidgetDelegate: |
112 virtual void DeleteDelegate() OVERRIDE { | 112 virtual void DeleteDelegate() override { |
113 delete this; | 113 delete this; |
114 } | 114 } |
115 virtual views::Widget* GetWidget() OVERRIDE { | 115 virtual views::Widget* GetWidget() override { |
116 return widget_; | 116 return widget_; |
117 } | 117 } |
118 virtual const views::Widget* GetWidget() const OVERRIDE { | 118 virtual const views::Widget* GetWidget() const override { |
119 return widget_; | 119 return widget_; |
120 } | 120 } |
121 virtual bool GetSavedWindowPlacement( | 121 virtual bool GetSavedWindowPlacement( |
122 const views::Widget* widget, | 122 const views::Widget* widget, |
123 gfx::Rect* bounds, | 123 gfx::Rect* bounds, |
124 ui::WindowShowState* show_state) const OVERRIDE { | 124 ui::WindowShowState* show_state) const override { |
125 bounds->SetRect(450, 10, 100, 100); | 125 bounds->SetRect(450, 10, 100, 100); |
126 *show_state = ui::SHOW_STATE_NORMAL; | 126 *show_state = ui::SHOW_STATE_NORMAL; |
127 return true; | 127 return true; |
128 } | 128 } |
129 | 129 |
130 private: | 130 private: |
131 views::Widget* widget_; | 131 views::Widget* widget_; |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(OutOfDisplayDelegate); | 133 DISALLOW_COPY_AND_ASSIGN(OutOfDisplayDelegate); |
134 }; | 134 }; |
(...skipping 12 matching lines...) Expand all Loading... |
147 widget->Init(params); | 147 widget->Init(params); |
148 widget->SetBounds(gfx::Rect(450,10, 100, 100)); | 148 widget->SetBounds(gfx::Rect(450,10, 100, 100)); |
149 wm::GetWindowState(widget->GetNativeView())->set_minimum_visibility(true); | 149 wm::GetWindowState(widget->GetNativeView())->set_minimum_visibility(true); |
150 widget->Show(); | 150 widget->Show(); |
151 // Make sure the bounds is adjusted to be inside the work area. | 151 // Make sure the bounds is adjusted to be inside the work area. |
152 EXPECT_EQ("390,10 100x100", widget->GetWindowBoundsInScreen().ToString()); | 152 EXPECT_EQ("390,10 100x100", widget->GetWindowBoundsInScreen().ToString()); |
153 widget->CloseNow(); | 153 widget->CloseNow(); |
154 } | 154 } |
155 | 155 |
156 } // namespace | 156 } // namespace |
OLD | NEW |