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

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

Issue 345603003: aura: Allow specifying the size of TestScreen when creating it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 "content/public/browser/context_factory.h" 5 #include "content/public/browser/context_factory.h"
6 #include "content/shell/browser/shell_browser_context.h" 6 #include "content/shell/browser/shell_browser_context.h"
7 #include "ui/aura/test/test_screen.h" 7 #include "ui/aura/test/test_screen.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/gfx/screen.h" 9 #include "ui/gfx/screen.h"
10 #include "ui/views_content_client/views_content_client.h" 10 #include "ui/views_content_client/views_content_client.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 ViewsContentClientMainPartsChromeOS::ViewsContentClientMainPartsChromeOS( 56 ViewsContentClientMainPartsChromeOS::ViewsContentClientMainPartsChromeOS(
57 const content::MainFunctionParams& content_params, 57 const content::MainFunctionParams& content_params,
58 ViewsContentClient* views_content_client) 58 ViewsContentClient* views_content_client)
59 : ViewsContentClientMainPartsAura(content_params, views_content_client) { 59 : ViewsContentClientMainPartsAura(content_params, views_content_client) {
60 } 60 }
61 61
62 void ViewsContentClientMainPartsChromeOS::PreMainMessageLoopRun() { 62 void ViewsContentClientMainPartsChromeOS::PreMainMessageLoopRun() {
63 ViewsContentClientMainPartsAura::PreMainMessageLoopRun(); 63 ViewsContentClientMainPartsAura::PreMainMessageLoopRun();
64 64
65 gfx::Screen::SetScreenInstance( 65 gfx::Size host_size(800, 600);
66 gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create()); 66 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE,
67 aura::TestScreen::Create(host_size));
sky 2014/06/19 14:51:08 Same question here about leaking.
67 // Set up basic pieces of views::corewm. 68 // Set up basic pieces of views::corewm.
68 wm_test_helper_.reset(new ::wm::WMTestHelper(gfx::Size(800, 600), 69 wm_test_helper_.reset(
69 content::GetContextFactory())); 70 new ::wm::WMTestHelper(host_size, content::GetContextFactory()));
70 // Ensure the X window gets mapped. 71 // Ensure the X window gets mapped.
71 wm_test_helper_->host()->Show(); 72 wm_test_helper_->host()->Show();
72 73
73 // Ensure Aura knows where to open new windows. 74 // Ensure Aura knows where to open new windows.
74 aura::Window* root_window = wm_test_helper_->host()->window(); 75 aura::Window* root_window = wm_test_helper_->host()->window();
75 views_content_client()->task().Run(browser_context(), root_window); 76 views_content_client()->task().Run(browser_context(), root_window);
76 77
77 nested_accelerator_controller_.reset( 78 nested_accelerator_controller_.reset(
78 new ::wm::NestedAcceleratorController(new NestedAcceleratorDelegate)); 79 new ::wm::NestedAcceleratorController(new NestedAcceleratorDelegate));
79 aura::client::SetDispatcherClient(root_window, 80 aura::client::SetDispatcherClient(root_window,
(...skipping 12 matching lines...) Expand all
92 93
93 // static 94 // static
94 ViewsContentClientMainParts* ViewsContentClientMainParts::Create( 95 ViewsContentClientMainParts* ViewsContentClientMainParts::Create(
95 const content::MainFunctionParams& content_params, 96 const content::MainFunctionParams& content_params,
96 ViewsContentClient* views_content_client) { 97 ViewsContentClient* views_content_client) {
97 return new ViewsContentClientMainPartsChromeOS( 98 return new ViewsContentClientMainPartsChromeOS(
98 content_params, views_content_client); 99 content_params, views_content_client);
99 } 100 }
100 101
101 } // namespace ui 102 } // namespace ui
OLDNEW
« content/shell/browser/shell_views.cc ('K') | « ui/aura/test/test_screen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698