Chromium Code Reviews

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

Issue 1948273004: Rename gfx::Screen/DIsplay to display::Screen/Display in ui/views_content_client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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/display/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/test/wm_test_helper.h" 13 #include "ui/wm/test/wm_test_helper.h"
14 14
15 namespace ui { 15 namespace ui {
16 16
17 namespace { 17 namespace {
18 18
19 class ViewsContentClientMainPartsChromeOS 19 class ViewsContentClientMainPartsChromeOS
20 : public ViewsContentClientMainPartsAura { 20 : public ViewsContentClientMainPartsAura {
21 public: 21 public:
22 ViewsContentClientMainPartsChromeOS( 22 ViewsContentClientMainPartsChromeOS(
23 const content::MainFunctionParams& content_params, 23 const content::MainFunctionParams& content_params,
24 ViewsContentClient* views_content_client); 24 ViewsContentClient* views_content_client);
25 ~ViewsContentClientMainPartsChromeOS() override {} 25 ~ViewsContentClientMainPartsChromeOS() override {}
26 26
27 // content::BrowserMainParts: 27 // content::BrowserMainParts:
28 void PreMainMessageLoopRun() override; 28 void PreMainMessageLoopRun() override;
29 void PostMainMessageLoopRun() override; 29 void PostMainMessageLoopRun() override;
30 30
31 private: 31 private:
32 // Enable a minimal set of views::corewm to be initialized. 32 // Enable a minimal set of views::corewm to be initialized.
33 std::unique_ptr<gfx::Screen> test_screen_; 33 std::unique_ptr<display::Screen> test_screen_;
34 std::unique_ptr<::wm::WMTestHelper> wm_test_helper_; 34 std::unique_ptr<::wm::WMTestHelper> wm_test_helper_;
35 35
36 DISALLOW_COPY_AND_ASSIGN(ViewsContentClientMainPartsChromeOS); 36 DISALLOW_COPY_AND_ASSIGN(ViewsContentClientMainPartsChromeOS);
37 }; 37 };
38 38
39 ViewsContentClientMainPartsChromeOS::ViewsContentClientMainPartsChromeOS( 39 ViewsContentClientMainPartsChromeOS::ViewsContentClientMainPartsChromeOS(
40 const content::MainFunctionParams& content_params, 40 const content::MainFunctionParams& content_params,
41 ViewsContentClient* views_content_client) 41 ViewsContentClient* views_content_client)
42 : ViewsContentClientMainPartsAura(content_params, views_content_client) { 42 : ViewsContentClientMainPartsAura(content_params, views_content_client) {
43 } 43 }
44 44
45 void ViewsContentClientMainPartsChromeOS::PreMainMessageLoopRun() { 45 void ViewsContentClientMainPartsChromeOS::PreMainMessageLoopRun() {
46 ViewsContentClientMainPartsAura::PreMainMessageLoopRun(); 46 ViewsContentClientMainPartsAura::PreMainMessageLoopRun();
47 47
48 gfx::Size host_size(800, 600); 48 gfx::Size host_size(800, 600);
49 test_screen_.reset(aura::TestScreen::Create(host_size)); 49 test_screen_.reset(aura::TestScreen::Create(host_size));
50 gfx::Screen::SetScreenInstance(test_screen_.get()); 50 display::Screen::SetScreenInstance(test_screen_.get());
51 // Set up basic pieces of views::corewm. 51 // Set up basic pieces of views::corewm.
52 wm_test_helper_.reset( 52 wm_test_helper_.reset(
53 new ::wm::WMTestHelper(host_size, content::GetContextFactory())); 53 new ::wm::WMTestHelper(host_size, content::GetContextFactory()));
54 // Ensure the X window gets mapped. 54 // Ensure the X window gets mapped.
55 wm_test_helper_->host()->Show(); 55 wm_test_helper_->host()->Show();
56 56
57 // Ensure Aura knows where to open new windows. 57 // Ensure Aura knows where to open new windows.
58 aura::Window* root_window = wm_test_helper_->host()->window(); 58 aura::Window* root_window = wm_test_helper_->host()->window();
59 views_content_client()->task().Run(browser_context(), root_window); 59 views_content_client()->task().Run(browser_context(), root_window);
60 } 60 }
61 61
62 void ViewsContentClientMainPartsChromeOS::PostMainMessageLoopRun() { 62 void ViewsContentClientMainPartsChromeOS::PostMainMessageLoopRun() {
63 wm_test_helper_.reset(); 63 wm_test_helper_.reset();
64 test_screen_.reset(); 64 test_screen_.reset();
65 65
66 ViewsContentClientMainPartsAura::PostMainMessageLoopRun(); 66 ViewsContentClientMainPartsAura::PostMainMessageLoopRun();
67 } 67 }
68 68
69 } // namespace 69 } // namespace
70 70
71 // static 71 // static
72 ViewsContentClientMainParts* ViewsContentClientMainParts::Create( 72 ViewsContentClientMainParts* ViewsContentClientMainParts::Create(
73 const content::MainFunctionParams& content_params, 73 const content::MainFunctionParams& content_params,
74 ViewsContentClient* views_content_client) { 74 ViewsContentClient* views_content_client) {
75 return new ViewsContentClientMainPartsChromeOS( 75 return new ViewsContentClientMainPartsChromeOS(
76 content_params, views_content_client); 76 content_params, views_content_client);
77 } 77 }
78 78
79 } // namespace ui 79 } // namespace ui
OLDNEW

Powered by Google App Engine