Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: views/desktop/desktop_window_view.cc

Issue 7741001: Add Aura support to views: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_view.h" 5 #include "views/desktop/desktop_window_view.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"
11 #include "views/desktop/desktop_window_manager.h" 11 #include "views/desktop/desktop_window_manager.h"
12 #include "views/layer_property_setter.h" 12 #include "views/layer_property_setter.h"
13 #include "views/widget/native_widget_view.h" 13 #include "views/widget/native_widget_view.h"
14 #include "views/widget/native_widget_views.h" 14 #include "views/widget/native_widget_views.h"
15 #include "views/widget/widget.h" 15 #include "views/widget/widget.h"
16 #include "views/window/native_frame_view.h" 16 #include "views/window/native_frame_view.h"
17 17
18 #if defined(OS_WIN) 18 #if defined(USE_AURA)
19 #include "views/widget/native_widget_aura.h"
20 #elif defined(OS_WIN)
19 #include "views/widget/native_widget_win.h" 21 #include "views/widget/native_widget_win.h"
20 #elif defined(TOOLKIT_USES_GTK) 22 #elif defined(TOOLKIT_USES_GTK)
21 #include "views/widget/native_widget_gtk.h" 23 #include "views/widget/native_widget_gtk.h"
22 #endif 24 #endif
23 25
24 namespace views { 26 namespace views {
25 namespace desktop { 27 namespace desktop {
26 28
27 // The Widget that hosts the DesktopWindowView. Subclasses Widget to override 29 // The Widget that hosts the DesktopWindowView. Subclasses Widget to override
28 // CreateRootView() so that the DesktopWindowRootView can be supplied instead 30 // CreateRootView() so that the DesktopWindowRootView can be supplied instead
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 views::Widget* window = new DesktopWindow(desktop_window_view); 132 views::Widget* window = new DesktopWindow(desktop_window_view);
131 desktop_window_view->widget_ = window; 133 desktop_window_view->widget_ = window;
132 134
133 WindowManager::Install(new DesktopWindowManager(window)); 135 WindowManager::Install(new DesktopWindowManager(window));
134 136
135 views::Widget::InitParams params; 137 views::Widget::InitParams params;
136 params.delegate = desktop_window_view; 138 params.delegate = desktop_window_view;
137 // In this environment, CreateChromeWindow will default to creating a views- 139 // In this environment, CreateChromeWindow will default to creating a views-
138 // window, so we need to construct a NativeWidgetWin by hand. 140 // window, so we need to construct a NativeWidgetWin by hand.
139 // TODO(beng): Replace this with NativeWindow::CreateNativeRootWindow(). 141 // TODO(beng): Replace this with NativeWindow::CreateNativeRootWindow().
140 #if defined(OS_WIN) 142 #if defined(USE_AURA)
143 params.native_widget = new views::NativeWidgetAura(window);
144 #elif defined(OS_WIN)
141 params.native_widget = new views::NativeWidgetWin(window); 145 params.native_widget = new views::NativeWidgetWin(window);
142 #elif defined(TOOLKIT_USES_GTK) 146 #elif defined(TOOLKIT_USES_GTK)
143 params.native_widget = new views::NativeWidgetGtk(window); 147 params.native_widget = new views::NativeWidgetGtk(window);
144 params.maximize = true; 148 params.maximize = true;
145 #endif 149 #endif
146 params.bounds = gfx::Rect(20, 20, 1920, 1200); 150 params.bounds = gfx::Rect(20, 20, 1920, 1200);
147 window->Init(params); 151 window->Init(params);
148 window->Show(); 152 window->Show();
149 } 153 }
150 154
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 active_native_widget_->GetWidget()->Deactivate(); 276 active_native_widget_->GetWidget()->Deactivate();
273 active_native_widget_ = 277 active_native_widget_ =
274 static_cast<NativeWidgetViews*>(widget->native_widget()); 278 static_cast<NativeWidgetViews*>(widget->native_widget());
275 } else if (widget == active_native_widget_->GetWidget()) { 279 } else if (widget == active_native_widget_->GetWidget()) {
276 active_native_widget_ = NULL; 280 active_native_widget_ = NULL;
277 } 281 }
278 } 282 }
279 283
280 } // namespace desktop 284 } // namespace desktop
281 } // namespace views 285 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698