| 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/desktop/desktop_stacking_client.h" | 10 #include "ui/aura/desktop/desktop_stacking_client.h" |
| 11 #include "ui/aura/display_manager.h" | 11 #include "ui/aura/display_manager.h" |
| 12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
| 13 #include "ui/aura/root_window.h" | 13 #include "ui/aura/root_window.h" |
| 14 #include "ui/aura/single_display_manager.h" | 14 #include "ui/aura/single_display_manager.h" |
| 15 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 16 #include "ui/base/accessibility/accessibility_types.h" | 16 #include "ui/base/accessibility/accessibility_types.h" |
| 17 #include "ui/base/clipboard/clipboard.h" | 17 #include "ui/base/clipboard/clipboard.h" |
| 18 #include "ui/base/events/event.h" | 18 #include "ui/base/events/event.h" |
| 19 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
| 20 #include "ui/gfx/screen.h" | 20 #include "ui/gfx/screen.h" |
| 21 #include "ui/views/controls/button/text_button.h" | 21 #include "ui/views/controls/button/text_button.h" |
| 22 #include "ui/views/controls/textfield/textfield.h" | 22 #include "ui/views/controls/textfield/textfield.h" |
| 23 #include "ui/views/controls/textfield/textfield_controller.h" | 23 #include "ui/views/controls/textfield/textfield_controller.h" |
| 24 #include "ui/views/controls/webview/webview.h" | 24 #include "ui/views/controls/webview/webview.h" |
| 25 #include "ui/views/layout/fill_layout.h" | 25 #include "ui/views/layout/fill_layout.h" |
| 26 #include "ui/views/layout/grid_layout.h" | 26 #include "ui/views/layout/grid_layout.h" |
| 27 #include "ui/views/view.h" | 27 #include "ui/views/view.h" |
| 28 #include "ui/views/test/test_views_delegate.h" | 28 #include "ui/views/test/test_views_delegate.h" |
| 29 #include "ui/views/views_switches.h" | |
| 30 #include "ui/views/widget/desktop_native_widget_aura.h" | 29 #include "ui/views/widget/desktop_native_widget_aura.h" |
| 31 #include "ui/views/widget/desktop_native_widget_helper_aura.h" | 30 #include "ui/views/widget/desktop_native_widget_helper_aura.h" |
| 32 #include "ui/views/widget/widget.h" | 31 #include "ui/views/widget/widget.h" |
| 33 #include "ui/views/widget/widget_delegate.h" | 32 #include "ui/views/widget/widget_delegate.h" |
| 34 | 33 |
| 35 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
| 36 #include "chromeos/dbus/dbus_thread_manager.h" | 35 #include "chromeos/dbus/dbus_thread_manager.h" |
| 37 #endif | 36 #endif |
| 38 | 37 |
| 39 // ViewDelegate implementation for aura content shell | 38 // ViewDelegate implementation for aura content shell |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // static | 284 // static |
| 286 void Shell::PlatformInitialize() { | 285 void Shell::PlatformInitialize() { |
| 287 #if defined(OS_CHROMEOS) | 286 #if defined(OS_CHROMEOS) |
| 288 chromeos::DBusThreadManager::Initialize(); | 287 chromeos::DBusThreadManager::Initialize(); |
| 289 #endif | 288 #endif |
| 290 aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager); | 289 aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager); |
| 291 stacking_client_ = new aura::DesktopStackingClient(); | 290 stacking_client_ = new aura::DesktopStackingClient(); |
| 292 gfx::Screen::SetScreenInstance( | 291 gfx::Screen::SetScreenInstance( |
| 293 gfx::SCREEN_TYPE_NATIVE, aura::CreateDesktopScreen()); | 292 gfx::SCREEN_TYPE_NATIVE, aura::CreateDesktopScreen()); |
| 294 views_delegate_ = new ShellViewsDelegateAura(); | 293 views_delegate_ = new ShellViewsDelegateAura(); |
| 295 | |
| 296 CommandLine::ForCurrentProcess()->AppendSwitch(views::switches::kDesktopAura); | |
| 297 } | 294 } |
| 298 | 295 |
| 299 void Shell::PlatformExit() { | 296 void Shell::PlatformExit() { |
| 300 #if defined(OS_CHROMEOS) | 297 #if defined(OS_CHROMEOS) |
| 301 chromeos::DBusThreadManager::Shutdown(); | 298 chromeos::DBusThreadManager::Shutdown(); |
| 302 #endif | 299 #endif |
| 303 if (stacking_client_) | 300 if (stacking_client_) |
| 304 delete stacking_client_; | 301 delete stacking_client_; |
| 305 if (views_delegate_) | 302 if (views_delegate_) |
| 306 delete views_delegate_; | 303 delete views_delegate_; |
| (...skipping 49 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 |