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

Side by Side Diff: chrome/test/base/view_event_test_platform_part_ash.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: GetNativeScreen Created 4 years, 11 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
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 "chrome/test/base/view_event_test_platform_part.h" 5 #include "chrome/test/base/view_event_test_platform_part.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "ui/aura/env.h" 9 #include "ui/aura/env.h"
10 #include "ui/gfx/screen.h" 10 #include "ui/gfx/screen.h"
(...skipping 19 matching lines...) Expand all
30 wm::WMState wm_state_; 30 wm::WMState wm_state_;
31 31
32 DISALLOW_COPY_AND_ASSIGN(ViewEventTestPlatformPartAsh); 32 DISALLOW_COPY_AND_ASSIGN(ViewEventTestPlatformPartAsh);
33 }; 33 };
34 34
35 ViewEventTestPlatformPartAsh::ViewEventTestPlatformPartAsh( 35 ViewEventTestPlatformPartAsh::ViewEventTestPlatformPartAsh(
36 ui::ContextFactory* context_factory) 36 ui::ContextFactory* context_factory)
37 : screen_(views::CreateDesktopScreen()) { 37 : screen_(views::CreateDesktopScreen()) {
38 // http://crbug.com/154081 use ash::Shell code path below on win_ash bots when 38 // http://crbug.com/154081 use ash::Shell code path below on win_ash bots when
39 // interactive_ui_tests is brought up on that platform. 39 // interactive_ui_tests is brought up on that platform.
40 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); 40 gfx::Screen::SetScreenInstance(screen_.get());
41 aura::Env::CreateInstance(true); 41 aura::Env::CreateInstance(true);
42 aura::Env::GetInstance()->set_context_factory(context_factory); 42 aura::Env::GetInstance()->set_context_factory(context_factory);
43 } 43 }
44 44
45 ViewEventTestPlatformPartAsh::~ViewEventTestPlatformPartAsh() { 45 ViewEventTestPlatformPartAsh::~ViewEventTestPlatformPartAsh() {
46 aura::Env::DeleteInstance(); 46 aura::Env::DeleteInstance();
47 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, nullptr); 47 gfx::Screen::SetScreenInstance(nullptr);
48 } 48 }
49 49
50 } // namespace 50 } // namespace
51 51
52 // static 52 // static
53 ViewEventTestPlatformPart* ViewEventTestPlatformPart::Create( 53 ViewEventTestPlatformPart* ViewEventTestPlatformPart::Create(
54 ui::ContextFactory* context_factory) { 54 ui::ContextFactory* context_factory) {
55 return new ViewEventTestPlatformPartAsh(context_factory); 55 return new ViewEventTestPlatformPartAsh(context_factory);
56 } 56 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698