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 "content/shell/shell.h" | 5 #include "content/shell/shell.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "ui/aura/display_manager.h" | |
10 #include "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
11 #include "ui/aura/root_window.h" | 10 #include "ui/aura/root_window.h" |
12 #include "ui/aura/single_display_manager.h" | |
13 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
14 #include "ui/base/accessibility/accessibility_types.h" | 12 #include "ui/base/accessibility/accessibility_types.h" |
15 #include "ui/base/clipboard/clipboard.h" | 13 #include "ui/base/clipboard/clipboard.h" |
16 #include "ui/base/events/event.h" | 14 #include "ui/base/events/event.h" |
17 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
18 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
19 #include "ui/views/controls/button/text_button.h" | 17 #include "ui/views/controls/button/text_button.h" |
20 #include "ui/views/controls/textfield/textfield.h" | 18 #include "ui/views/controls/textfield/textfield.h" |
21 #include "ui/views/controls/textfield/textfield_controller.h" | 19 #include "ui/views/controls/textfield/textfield_controller.h" |
22 #include "ui/views/controls/webview/webview.h" | 20 #include "ui/views/controls/webview/webview.h" |
23 #include "ui/views/layout/fill_layout.h" | 21 #include "ui/views/layout/fill_layout.h" |
24 #include "ui/views/layout/grid_layout.h" | 22 #include "ui/views/layout/grid_layout.h" |
25 #include "ui/views/view.h" | 23 #include "ui/views/view.h" |
26 #include "ui/views/test/desktop_test_views_delegate.h" | 24 #include "ui/views/test/desktop_test_views_delegate.h" |
27 #include "ui/views/widget/desktop_aura/desktop_screen.h" | 25 #include "ui/views/widget/desktop_aura/desktop_screen.h" |
28 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
29 #include "ui/views/widget/widget_delegate.h" | 27 #include "ui/views/widget/widget_delegate.h" |
30 | 28 |
31 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
32 #include "ash/screen_ash.h" | |
33 #include "chromeos/dbus/dbus_thread_manager.h" | 30 #include "chromeos/dbus/dbus_thread_manager.h" |
34 #include "content/shell/shell_stacking_client_ash.h" | 31 #include "content/shell/shell_stacking_client_ash.h" |
| 32 #include "ui/aura/test/test_screen.h" |
35 #else | 33 #else |
36 #include "ui/views/widget/desktop_aura/desktop_stacking_client.h" | 34 #include "ui/views/widget/desktop_aura/desktop_stacking_client.h" |
37 #endif | 35 #endif |
38 | 36 |
39 // ViewDelegate implementation for aura content shell | 37 // ViewDelegate implementation for aura content shell |
40 class ShellViewsDelegateAura : public views::DesktopTestViewsDelegate { | 38 class ShellViewsDelegateAura : public views::DesktopTestViewsDelegate { |
41 public: | 39 public: |
42 ShellViewsDelegateAura() : use_transparent_windows_(false) { | 40 ShellViewsDelegateAura() : use_transparent_windows_(false) { |
43 } | 41 } |
44 | 42 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 namespace content { | 274 namespace content { |
277 | 275 |
278 aura::client::StackingClient* Shell::stacking_client_ = NULL; | 276 aura::client::StackingClient* Shell::stacking_client_ = NULL; |
279 views::ViewsDelegate* Shell::views_delegate_ = NULL; | 277 views::ViewsDelegate* Shell::views_delegate_ = NULL; |
280 | 278 |
281 // static | 279 // static |
282 void Shell::PlatformInitialize() { | 280 void Shell::PlatformInitialize() { |
283 #if defined(OS_CHROMEOS) | 281 #if defined(OS_CHROMEOS) |
284 chromeos::DBusThreadManager::Initialize(); | 282 chromeos::DBusThreadManager::Initialize(); |
285 #endif | 283 #endif |
286 aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager); | |
287 #if defined(OS_CHROMEOS) | 284 #if defined(OS_CHROMEOS) |
288 stacking_client_ = new content::ShellStackingClientAsh(); | 285 stacking_client_ = new content::ShellStackingClientAsh(); |
289 gfx::Screen::SetScreenInstance( | 286 gfx::Screen::SetScreenInstance( |
290 gfx::SCREEN_TYPE_NATIVE, new ash::ScreenAsh); | 287 gfx::SCREEN_TYPE_NATIVE, new aura::TestScreen); |
291 #else | 288 #else |
292 stacking_client_ = new views::DesktopStackingClient(); | 289 stacking_client_ = new views::DesktopStackingClient(); |
293 gfx::Screen::SetScreenInstance( | 290 gfx::Screen::SetScreenInstance( |
294 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); | 291 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); |
295 #endif | 292 #endif |
296 aura::client::SetStackingClient(stacking_client_); | 293 aura::client::SetStackingClient(stacking_client_); |
297 views_delegate_ = new ShellViewsDelegateAura(); | 294 views_delegate_ = new ShellViewsDelegateAura(); |
298 } | 295 } |
299 | 296 |
300 void Shell::PlatformExit() { | 297 void Shell::PlatformExit() { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 } | 354 } |
358 | 355 |
359 void Shell::PlatformSetTitle(const string16& title) { | 356 void Shell::PlatformSetTitle(const string16& title) { |
360 ShellWindowDelegateView* delegate_view = | 357 ShellWindowDelegateView* delegate_view = |
361 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 358 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
362 delegate_view->SetWindowTitle(title); | 359 delegate_view->SetWindowTitle(title); |
363 window_widget_->UpdateWindowTitle(); | 360 window_widget_->UpdateWindowTitle(); |
364 } | 361 } |
365 | 362 |
366 } // namespace content | 363 } // namespace content |
OLD | NEW |