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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #endif | 47 #endif |
48 | 48 |
49 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
50 #include <fcntl.h> | 50 #include <fcntl.h> |
51 #include <io.h> | 51 #include <io.h> |
52 #endif | 52 #endif |
53 | 53 |
54 namespace content { | 54 namespace content { |
55 | 55 |
56 namespace { | 56 namespace { |
57 // ViewDelegate implementation for aura content shell | |
58 class ShellViewsDelegateAura : public views::DesktopTestViewsDelegate { | |
59 public: | |
60 ShellViewsDelegateAura() : use_transparent_windows_(false) { | |
61 } | |
62 | |
63 ~ShellViewsDelegateAura() override {} | |
64 | |
65 void SetUseTransparentWindows(bool transparent) { | |
66 use_transparent_windows_ = transparent; | |
67 } | |
68 | |
69 private: | |
70 bool use_transparent_windows_; | |
71 | |
72 DISALLOW_COPY_AND_ASSIGN(ShellViewsDelegateAura); | |
73 }; | |
74 | 57 |
75 // Model for the "Debug" menu | 58 // Model for the "Debug" menu |
76 class ContextMenuModel : public ui::SimpleMenuModel, | 59 class ContextMenuModel : public ui::SimpleMenuModel, |
77 public ui::SimpleMenuModel::Delegate { | 60 public ui::SimpleMenuModel::Delegate { |
78 public: | 61 public: |
79 explicit ContextMenuModel( | 62 explicit ContextMenuModel( |
80 Shell* shell, const content::ContextMenuParams& params) | 63 Shell* shell, const content::ContextMenuParams& params) |
81 : ui::SimpleMenuModel(this), | 64 : ui::SimpleMenuModel(this), |
82 shell_(shell), | 65 shell_(shell), |
83 params_(params) { | 66 params_(params) { |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 #endif | 397 #endif |
415 #if defined(OS_CHROMEOS) | 398 #if defined(OS_CHROMEOS) |
416 test_screen_ = aura::TestScreen::Create(gfx::Size()); | 399 test_screen_ = aura::TestScreen::Create(gfx::Size()); |
417 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_); | 400 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_); |
418 wm_test_helper_ = new wm::WMTestHelper(default_window_size, | 401 wm_test_helper_ = new wm::WMTestHelper(default_window_size, |
419 GetContextFactory()); | 402 GetContextFactory()); |
420 #else | 403 #else |
421 gfx::Screen::SetScreenInstance( | 404 gfx::Screen::SetScreenInstance( |
422 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); | 405 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); |
423 #endif | 406 #endif |
424 views_delegate_ = new ShellViewsDelegateAura(); | 407 views_delegate_ = new views::DesktopTestViewsDelegate(); |
425 } | 408 } |
426 | 409 |
427 void Shell::PlatformExit() { | 410 void Shell::PlatformExit() { |
428 #if defined(OS_CHROMEOS) | 411 #if defined(OS_CHROMEOS) |
429 delete wm_test_helper_; | 412 delete wm_test_helper_; |
430 wm_test_helper_ = NULL; | 413 wm_test_helper_ = NULL; |
431 | 414 |
432 delete test_screen_; | 415 delete test_screen_; |
433 test_screen_ = NULL; | 416 test_screen_ = NULL; |
434 #endif | 417 #endif |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 const content::ContextMenuParams& params) { | 528 const content::ContextMenuParams& params) { |
546 if (headless_) | 529 if (headless_) |
547 return true; | 530 return true; |
548 ShellWindowDelegateView* delegate_view = | 531 ShellWindowDelegateView* delegate_view = |
549 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 532 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
550 delegate_view->ShowWebViewContextMenu(params); | 533 delegate_view->ShowWebViewContextMenu(params); |
551 return true; | 534 return true; |
552 } | 535 } |
553 | 536 |
554 } // namespace content | 537 } // namespace content |
OLD | NEW |