| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/shell.h" | 5 #include "content/shell/browser/shell.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/public/browser/context_factory.h" |
| 9 #include "content/public/browser/render_widget_host_view.h" | 10 #include "content/public/browser/render_widget_host_view.h" |
| 10 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 11 #include "content/public/common/context_menu_params.h" | 12 #include "content/public/common/context_menu_params.h" |
| 12 #include "content/shell/browser/shell_platform_data_aura.h" | 13 #include "content/shell/browser/shell_platform_data_aura.h" |
| 13 #include "ui/aura/client/screen_position_client.h" | 14 #include "ui/aura/client/screen_position_client.h" |
| 14 #include "ui/aura/env.h" | 15 #include "ui/aura/env.h" |
| 15 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 16 #include "ui/aura/window_event_dispatcher.h" | 17 #include "ui/aura/window_event_dispatcher.h" |
| 17 #include "ui/base/clipboard/clipboard.h" | 18 #include "ui/base/clipboard/clipboard.h" |
| 18 #include "ui/base/models/simple_menu_model.h" | 19 #include "ui/base/models/simple_menu_model.h" |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // static | 418 // static |
| 418 void Shell::PlatformInitialize(const gfx::Size& default_window_size) { | 419 void Shell::PlatformInitialize(const gfx::Size& default_window_size) { |
| 419 #if defined(OS_WIN) | 420 #if defined(OS_WIN) |
| 420 _setmode(_fileno(stdout), _O_BINARY); | 421 _setmode(_fileno(stdout), _O_BINARY); |
| 421 _setmode(_fileno(stderr), _O_BINARY); | 422 _setmode(_fileno(stderr), _O_BINARY); |
| 422 #endif | 423 #endif |
| 423 #if defined(OS_CHROMEOS) | 424 #if defined(OS_CHROMEOS) |
| 424 chromeos::DBusThreadManager::Initialize(); | 425 chromeos::DBusThreadManager::Initialize(); |
| 425 gfx::Screen::SetScreenInstance( | 426 gfx::Screen::SetScreenInstance( |
| 426 gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create()); | 427 gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create()); |
| 427 wm_test_helper_ = new wm::WMTestHelper(default_window_size); | 428 wm_test_helper_ = new wm::WMTestHelper(default_window_size, |
| 429 GetContextFactory()); |
| 428 #else | 430 #else |
| 429 gfx::Screen::SetScreenInstance( | 431 gfx::Screen::SetScreenInstance( |
| 430 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); | 432 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); |
| 431 #endif | 433 #endif |
| 432 views_delegate_ = new ShellViewsDelegateAura(); | 434 views_delegate_ = new ShellViewsDelegateAura(); |
| 433 } | 435 } |
| 434 | 436 |
| 435 void Shell::PlatformExit() { | 437 void Shell::PlatformExit() { |
| 436 #if defined(OS_CHROMEOS) | 438 #if defined(OS_CHROMEOS) |
| 437 delete wm_test_helper_; | 439 delete wm_test_helper_; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 | 564 |
| 563 void Shell::PlatformWebContentsFocused(WebContents* contents) { | 565 void Shell::PlatformWebContentsFocused(WebContents* contents) { |
| 564 if (headless_) | 566 if (headless_) |
| 565 return; | 567 return; |
| 566 ShellWindowDelegateView* delegate_view = | 568 ShellWindowDelegateView* delegate_view = |
| 567 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 569 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
| 568 delegate_view->OnWebContentsFocused(contents); | 570 delegate_view->OnWebContentsFocused(contents); |
| 569 } | 571 } |
| 570 | 572 |
| 571 } // namespace content | 573 } // namespace content |
| OLD | NEW |