OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/desktop/desktop_window.h" | 5 #include "views/desktop/desktop_window.h" |
6 | 6 |
7 #include "ui/gfx/canvas.h" | 7 #include "ui/gfx/canvas.h" |
8 #include "ui/gfx/transform.h" | 8 #include "ui/gfx/transform.h" |
9 #include "views/desktop/desktop_background.h" | 9 #include "views/desktop/desktop_background.h" |
10 #include "views/desktop/desktop_window_root_view.h" | 10 #include "views/desktop/desktop_window_root_view.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 #elif defined(TOOLKIT_USES_GTK) | 92 #elif defined(TOOLKIT_USES_GTK) |
93 params.native_widget = new views::NativeWidgetGtk(window); | 93 params.native_widget = new views::NativeWidgetGtk(window); |
94 #endif | 94 #endif |
95 params.bounds = gfx::Rect(20, 20, 1920, 1200); | 95 params.bounds = gfx::Rect(20, 20, 1920, 1200); |
96 window->Init(params); | 96 window->Init(params); |
97 window->Show(); | 97 window->Show(); |
98 | 98 |
99 desktop->CreateTestWindow(L"Sample Window 1", SK_ColorWHITE, | 99 desktop->CreateTestWindow(L"Sample Window 1", SK_ColorWHITE, |
100 gfx::Rect(500, 200, 400, 400), true); | 100 gfx::Rect(500, 200, 400, 400), true); |
101 desktop->CreateTestWindow(L"Sample Window 2", SK_ColorRED, | 101 desktop->CreateTestWindow(L"Sample Window 2", SK_ColorRED, |
102 gfx::Rect(600, 650, 450, 300), false); | 102 gfx::Rect(600, 450, 450, 300), false); |
103 } | 103 } |
104 | 104 |
105 void DesktopWindow::ActivateWidget(Widget* widget) { | 105 void DesktopWindow::ActivateWidget(Widget* widget) { |
106 if (widget && widget->IsActive()) | 106 if (widget && widget->IsActive()) |
107 return; | 107 return; |
108 | 108 |
109 if (active_widget_) | 109 if (active_widget_) |
110 active_widget_->OnActivate(false); | 110 active_widget_->OnActivate(false); |
111 if (widget) { | 111 if (widget) { |
| 112 widget->MoveToTop(); |
112 active_widget_ = static_cast<NativeWidgetViews*>(widget->native_widget()); | 113 active_widget_ = static_cast<NativeWidgetViews*>(widget->native_widget()); |
113 active_widget_->OnActivate(true); | 114 active_widget_->OnActivate(true); |
114 } | 115 } |
115 } | 116 } |
116 | 117 |
117 //////////////////////////////////////////////////////////////////////////////// | 118 //////////////////////////////////////////////////////////////////////////////// |
118 // DesktopWindow, View overrides: | 119 // DesktopWindow, View overrides: |
119 | 120 |
120 void DesktopWindow::Layout() { | 121 void DesktopWindow::Layout() { |
121 } | 122 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 if (rotate) { | 175 if (rotate) { |
175 ui::Transform transform; | 176 ui::Transform transform; |
176 transform.SetRotate(90.0f); | 177 transform.SetRotate(90.0f); |
177 transform.SetTranslateX(window->GetWindowScreenBounds().width()); | 178 transform.SetTranslateX(window->GetWindowScreenBounds().width()); |
178 nwv->GetView()->SetTransform(transform); | 179 nwv->GetView()->SetTransform(transform); |
179 } | 180 } |
180 } | 181 } |
181 | 182 |
182 } // namespace desktop | 183 } // namespace desktop |
183 } // namespace views | 184 } // namespace views |
OLD | NEW |