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/context_factory.h" |
10 #include "content/public/browser/render_widget_host_view.h" | 10 #include "content/public/browser/render_widget_host_view.h" |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 View* contents_view_; | 405 View* contents_view_; |
406 views::WebView* web_view_; | 406 views::WebView* web_view_; |
407 | 407 |
408 DISALLOW_COPY_AND_ASSIGN(ShellWindowDelegateView); | 408 DISALLOW_COPY_AND_ASSIGN(ShellWindowDelegateView); |
409 }; | 409 }; |
410 | 410 |
411 } // namespace | 411 } // namespace |
412 | 412 |
413 #if defined(OS_CHROMEOS) | 413 #if defined(OS_CHROMEOS) |
414 wm::WMTestHelper* Shell::wm_test_helper_ = NULL; | 414 wm::WMTestHelper* Shell::wm_test_helper_ = NULL; |
| 415 gfx::Screen* Shell::test_screen_ = NULL; |
415 #endif | 416 #endif |
416 views::ViewsDelegate* Shell::views_delegate_ = NULL; | 417 views::ViewsDelegate* Shell::views_delegate_ = NULL; |
417 | 418 |
418 // static | 419 // static |
419 void Shell::PlatformInitialize(const gfx::Size& default_window_size) { | 420 void Shell::PlatformInitialize(const gfx::Size& default_window_size) { |
420 #if defined(OS_WIN) | 421 #if defined(OS_WIN) |
421 _setmode(_fileno(stdout), _O_BINARY); | 422 _setmode(_fileno(stdout), _O_BINARY); |
422 _setmode(_fileno(stderr), _O_BINARY); | 423 _setmode(_fileno(stderr), _O_BINARY); |
423 #endif | 424 #endif |
424 #if defined(OS_CHROMEOS) | 425 #if defined(OS_CHROMEOS) |
425 chromeos::DBusThreadManager::Initialize(); | 426 chromeos::DBusThreadManager::Initialize(); |
426 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, | 427 test_screen_ = aura::TestScreen::Create(gfx::Size()); |
427 aura::TestScreen::Create(gfx::Size())); | 428 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_); |
428 wm_test_helper_ = new wm::WMTestHelper(default_window_size, | 429 wm_test_helper_ = new wm::WMTestHelper(default_window_size, |
429 GetContextFactory()); | 430 GetContextFactory()); |
430 #else | 431 #else |
431 gfx::Screen::SetScreenInstance( | 432 gfx::Screen::SetScreenInstance( |
432 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); | 433 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); |
433 #endif | 434 #endif |
434 views_delegate_ = new ShellViewsDelegateAura(); | 435 views_delegate_ = new ShellViewsDelegateAura(); |
435 } | 436 } |
436 | 437 |
437 void Shell::PlatformExit() { | 438 void Shell::PlatformExit() { |
438 #if defined(OS_CHROMEOS) | 439 #if defined(OS_CHROMEOS) |
439 delete wm_test_helper_; | 440 delete wm_test_helper_; |
440 wm_test_helper_ = NULL; | 441 wm_test_helper_ = NULL; |
| 442 |
| 443 delete test_screen_; |
| 444 test_screen_ = NULL; |
441 #endif | 445 #endif |
442 delete views_delegate_; | 446 delete views_delegate_; |
443 views_delegate_ = NULL; | 447 views_delegate_ = NULL; |
444 delete platform_; | 448 delete platform_; |
445 platform_ = NULL; | 449 platform_ = NULL; |
446 #if defined(OS_CHROMEOS) | 450 #if defined(OS_CHROMEOS) |
447 chromeos::DBusThreadManager::Shutdown(); | 451 chromeos::DBusThreadManager::Shutdown(); |
448 #endif | 452 #endif |
449 aura::Env::DeleteInstance(); | 453 aura::Env::DeleteInstance(); |
450 } | 454 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 568 |
565 void Shell::PlatformWebContentsFocused(WebContents* contents) { | 569 void Shell::PlatformWebContentsFocused(WebContents* contents) { |
566 if (headless_) | 570 if (headless_) |
567 return; | 571 return; |
568 ShellWindowDelegateView* delegate_view = | 572 ShellWindowDelegateView* delegate_view = |
569 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 573 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
570 delegate_view->OnWebContentsFocused(contents); | 574 delegate_view->OnWebContentsFocused(contents); |
571 } | 575 } |
572 | 576 |
573 } // namespace content | 577 } // namespace content |
OLD | NEW |