Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: ui/views_content_client/views_content_client_main_parts_chromeos.cc

Issue 1647933002: ash/wm: Remove dead code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc ('k') | ui/wm/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "content/public/browser/context_factory.h" 6 #include "content/public/browser/context_factory.h"
7 #include "content/shell/browser/shell_browser_context.h" 7 #include "content/shell/browser/shell_browser_context.h"
8 #include "ui/aura/test/test_screen.h" 8 #include "ui/aura/test/test_screen.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/gfx/screen.h" 10 #include "ui/gfx/screen.h"
11 #include "ui/views_content_client/views_content_client.h" 11 #include "ui/views_content_client/views_content_client.h"
12 #include "ui/views_content_client/views_content_client_main_parts_aura.h" 12 #include "ui/views_content_client/views_content_client_main_parts_aura.h"
13 #include "ui/wm/core/nested_accelerator_controller.h"
14 #include "ui/wm/core/nested_accelerator_delegate.h"
15 #include "ui/wm/test/wm_test_helper.h" 13 #include "ui/wm/test/wm_test_helper.h"
16 14
17 namespace ui { 15 namespace ui {
18 16
19 namespace { 17 namespace {
20 18
21 // A dummy version of the delegate usually provided by the Ash Shell.
22 class NestedAcceleratorDelegate : public ::wm::NestedAcceleratorDelegate {
23 public:
24 NestedAcceleratorDelegate() {}
25 ~NestedAcceleratorDelegate() override {}
26
27 // ::wm::NestedAcceleratorDelegate:
28 Result ProcessAccelerator(const ui::Accelerator& accelerator) override {
29 return RESULT_NOT_PROCESSED;
30 }
31
32 private:
33 DISALLOW_COPY_AND_ASSIGN(NestedAcceleratorDelegate);
34 };
35
36 class ViewsContentClientMainPartsChromeOS 19 class ViewsContentClientMainPartsChromeOS
37 : public ViewsContentClientMainPartsAura { 20 : public ViewsContentClientMainPartsAura {
38 public: 21 public:
39 ViewsContentClientMainPartsChromeOS( 22 ViewsContentClientMainPartsChromeOS(
40 const content::MainFunctionParams& content_params, 23 const content::MainFunctionParams& content_params,
41 ViewsContentClient* views_content_client); 24 ViewsContentClient* views_content_client);
42 ~ViewsContentClientMainPartsChromeOS() override {} 25 ~ViewsContentClientMainPartsChromeOS() override {}
43 26
44 // content::BrowserMainParts: 27 // content::BrowserMainParts:
45 void PreMainMessageLoopRun() override; 28 void PreMainMessageLoopRun() override;
46 void PostMainMessageLoopRun() override; 29 void PostMainMessageLoopRun() override;
47 30
48 private: 31 private:
49 // Enable a minimal set of views::corewm to be initialized. 32 // Enable a minimal set of views::corewm to be initialized.
50 scoped_ptr<gfx::Screen> test_screen_; 33 scoped_ptr<gfx::Screen> test_screen_;
51 scoped_ptr< ::wm::WMTestHelper> wm_test_helper_; 34 scoped_ptr< ::wm::WMTestHelper> wm_test_helper_;
52 scoped_ptr< ::wm::NestedAcceleratorController> nested_accelerator_controller_;
53 35
54 DISALLOW_COPY_AND_ASSIGN(ViewsContentClientMainPartsChromeOS); 36 DISALLOW_COPY_AND_ASSIGN(ViewsContentClientMainPartsChromeOS);
55 }; 37 };
56 38
57 ViewsContentClientMainPartsChromeOS::ViewsContentClientMainPartsChromeOS( 39 ViewsContentClientMainPartsChromeOS::ViewsContentClientMainPartsChromeOS(
58 const content::MainFunctionParams& content_params, 40 const content::MainFunctionParams& content_params,
59 ViewsContentClient* views_content_client) 41 ViewsContentClient* views_content_client)
60 : ViewsContentClientMainPartsAura(content_params, views_content_client) { 42 : ViewsContentClientMainPartsAura(content_params, views_content_client) {
61 } 43 }
62 44
63 void ViewsContentClientMainPartsChromeOS::PreMainMessageLoopRun() { 45 void ViewsContentClientMainPartsChromeOS::PreMainMessageLoopRun() {
64 ViewsContentClientMainPartsAura::PreMainMessageLoopRun(); 46 ViewsContentClientMainPartsAura::PreMainMessageLoopRun();
65 47
66 gfx::Size host_size(800, 600); 48 gfx::Size host_size(800, 600);
67 test_screen_.reset(aura::TestScreen::Create(host_size)); 49 test_screen_.reset(aura::TestScreen::Create(host_size));
68 gfx::Screen::SetScreenInstance(test_screen_.get()); 50 gfx::Screen::SetScreenInstance(test_screen_.get());
69 // Set up basic pieces of views::corewm. 51 // Set up basic pieces of views::corewm.
70 wm_test_helper_.reset( 52 wm_test_helper_.reset(
71 new ::wm::WMTestHelper(host_size, content::GetContextFactory())); 53 new ::wm::WMTestHelper(host_size, content::GetContextFactory()));
72 // Ensure the X window gets mapped. 54 // Ensure the X window gets mapped.
73 wm_test_helper_->host()->Show(); 55 wm_test_helper_->host()->Show();
74 56
75 // Ensure Aura knows where to open new windows. 57 // Ensure Aura knows where to open new windows.
76 aura::Window* root_window = wm_test_helper_->host()->window(); 58 aura::Window* root_window = wm_test_helper_->host()->window();
77 views_content_client()->task().Run(browser_context(), root_window); 59 views_content_client()->task().Run(browser_context(), root_window);
78
79 nested_accelerator_controller_.reset(
80 new ::wm::NestedAcceleratorController(new NestedAcceleratorDelegate));
81 aura::client::SetDispatcherClient(root_window,
82 nested_accelerator_controller_.get());
83 } 60 }
84 61
85 void ViewsContentClientMainPartsChromeOS::PostMainMessageLoopRun() { 62 void ViewsContentClientMainPartsChromeOS::PostMainMessageLoopRun() {
86 aura::client::SetDispatcherClient(wm_test_helper_->host()->window(), NULL);
87 nested_accelerator_controller_.reset();
88 wm_test_helper_.reset(); 63 wm_test_helper_.reset();
89 test_screen_.reset(); 64 test_screen_.reset();
90 65
91 ViewsContentClientMainPartsAura::PostMainMessageLoopRun(); 66 ViewsContentClientMainPartsAura::PostMainMessageLoopRun();
92 } 67 }
93 68
94 } // namespace 69 } // namespace
95 70
96 // static 71 // static
97 ViewsContentClientMainParts* ViewsContentClientMainParts::Create( 72 ViewsContentClientMainParts* ViewsContentClientMainParts::Create(
98 const content::MainFunctionParams& content_params, 73 const content::MainFunctionParams& content_params,
99 ViewsContentClient* views_content_client) { 74 ViewsContentClient* views_content_client) {
100 return new ViewsContentClientMainPartsChromeOS( 75 return new ViewsContentClientMainPartsChromeOS(
101 content_params, views_content_client); 76 content_params, views_content_client);
102 } 77 }
103 78
104 } // namespace ui 79 } // namespace ui
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc ('k') | ui/wm/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698