| 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/desktop/desktop_screen.h" | 9 #include "ui/aura/desktop/desktop_screen.h" |
| 10 #include "ui/aura/display_manager.h" | |
| 11 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
| 12 #include "ui/aura/root_window.h" | 11 #include "ui/aura/root_window.h" |
| 13 #include "ui/aura/single_display_manager.h" | |
| 14 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 15 #include "ui/base/accessibility/accessibility_types.h" | 13 #include "ui/base/accessibility/accessibility_types.h" |
| 16 #include "ui/base/clipboard/clipboard.h" | 14 #include "ui/base/clipboard/clipboard.h" |
| 17 #include "ui/base/events/event.h" | 15 #include "ui/base/events/event.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
| 19 #include "ui/gfx/screen.h" | 17 #include "ui/gfx/screen.h" |
| 20 #include "ui/views/controls/button/text_button.h" | 18 #include "ui/views/controls/button/text_button.h" |
| 21 #include "ui/views/controls/textfield/textfield.h" | 19 #include "ui/views/controls/textfield/textfield.h" |
| 22 #include "ui/views/controls/textfield/textfield_controller.h" | 20 #include "ui/views/controls/textfield/textfield_controller.h" |
| 23 #include "ui/views/controls/webview/webview.h" | 21 #include "ui/views/controls/webview/webview.h" |
| 24 #include "ui/views/layout/fill_layout.h" | 22 #include "ui/views/layout/fill_layout.h" |
| 25 #include "ui/views/layout/grid_layout.h" | 23 #include "ui/views/layout/grid_layout.h" |
| 26 #include "ui/views/view.h" | 24 #include "ui/views/view.h" |
| 27 #include "ui/views/test/desktop_test_views_delegate.h" | 25 #include "ui/views/test/desktop_test_views_delegate.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/aura/desktop/desktop_stacking_client.h" | 34 #include "ui/aura/desktop/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 aura::DesktopStackingClient(); | 289 stacking_client_ = new aura::DesktopStackingClient(); |
| 293 gfx::Screen::SetScreenInstance( | 290 gfx::Screen::SetScreenInstance( |
| 294 gfx::SCREEN_TYPE_NATIVE, aura::CreateDesktopScreen()); | 291 gfx::SCREEN_TYPE_NATIVE, aura::CreateDesktopScreen()); |
| 295 #endif | 292 #endif |
| 296 views_delegate_ = new ShellViewsDelegateAura(); | 293 views_delegate_ = new ShellViewsDelegateAura(); |
| 297 } | 294 } |
| 298 | 295 |
| 299 void Shell::PlatformExit() { | 296 void Shell::PlatformExit() { |
| 300 if (stacking_client_) | 297 if (stacking_client_) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 } | 353 } |
| 357 | 354 |
| 358 void Shell::PlatformSetTitle(const string16& title) { | 355 void Shell::PlatformSetTitle(const string16& title) { |
| 359 ShellWindowDelegateView* delegate_view = | 356 ShellWindowDelegateView* delegate_view = |
| 360 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 357 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
| 361 delegate_view->SetWindowTitle(title); | 358 delegate_view->SetWindowTitle(title); |
| 362 window_widget_->UpdateWindowTitle(); | 359 window_widget_->UpdateWindowTitle(); |
| 363 } | 360 } |
| 364 | 361 |
| 365 } // namespace content | 362 } // namespace content |
| OLD | NEW |