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

Side by Side Diff: ui/aura/test/test_screen.cc

Issue 273073002: Changes code using Compositor to pass in ContextFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tooltip on chromeos Created 6 years, 7 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
« no previous file with comments | « ui/aura/test/test_screen.h ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/aura/test/test_screen.h" 5 #include "ui/aura/test/test_screen.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/aura/env.h" 8 #include "ui/aura/env.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/aura/window_event_dispatcher.h" 10 #include "ui/aura/window_event_dispatcher.h"
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 25
26 // static 26 // static
27 TestScreen* TestScreen::CreateFullscreen() { 27 TestScreen* TestScreen::CreateFullscreen() {
28 return new TestScreen(gfx::Rect(WindowTreeHost::GetNativeScreenSize())); 28 return new TestScreen(gfx::Rect(WindowTreeHost::GetNativeScreenSize()));
29 } 29 }
30 30
31 TestScreen::~TestScreen() { 31 TestScreen::~TestScreen() {
32 } 32 }
33 33
34 WindowTreeHost* TestScreen::CreateHostForPrimaryDisplay() { 34 WindowTreeHost* TestScreen::CreateHostForPrimaryDisplay(
35 ui::ContextFactory* context_factory) {
35 DCHECK(!host_); 36 DCHECK(!host_);
36 host_ = WindowTreeHost::Create(gfx::Rect(display_.GetSizeInPixel())); 37 host_ = WindowTreeHost::Create(gfx::Rect(display_.GetSizeInPixel()),
38 context_factory);
37 host_->window()->AddObserver(this); 39 host_->window()->AddObserver(this);
38 host_->InitHost(); 40 host_->InitHost();
39 return host_; 41 return host_;
40 } 42 }
41 43
42 void TestScreen::SetDeviceScaleFactor(float device_scale_factor) { 44 void TestScreen::SetDeviceScaleFactor(float device_scale_factor) {
43 gfx::Rect bounds_in_pixel(display_.GetSizeInPixel()); 45 gfx::Rect bounds_in_pixel(display_.GetSizeInPixel());
44 display_.SetScaleAndBounds(device_scale_factor, bounds_in_pixel); 46 display_.SetScaleAndBounds(device_scale_factor, bounds_in_pixel);
45 host_->OnHostResized(bounds_in_pixel.size()); 47 host_->OnHostResized(bounds_in_pixel.size());
46 } 48 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 153
152 TestScreen::TestScreen(const gfx::Rect& screen_bounds) 154 TestScreen::TestScreen(const gfx::Rect& screen_bounds)
153 : host_(NULL), 155 : host_(NULL),
154 ui_scale_(1.0f) { 156 ui_scale_(1.0f) {
155 static int64 synthesized_display_id = 2000; 157 static int64 synthesized_display_id = 2000;
156 display_.set_id(synthesized_display_id++); 158 display_.set_id(synthesized_display_id++);
157 display_.SetScaleAndBounds(1.0f, screen_bounds); 159 display_.SetScaleAndBounds(1.0f, screen_bounds);
158 } 160 }
159 161
160 } // namespace aura 162 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/test_screen.h ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698