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

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

Issue 2563783002: ui + mus: Split ContextFactory into ContextFactory(Client) and ContextFactoryPrivate (Closed)
Patch Set: Restore mash Created 4 years 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 <memory> 7 #include <memory>
8 8
9 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
10 #include "ash/common/test/test_session_state_delegate.h" 10 #include "ash/common/test/test_session_state_delegate.h"
(...skipping 12 matching lines...) Expand all
23 #include "ui/aura/window_tree_host.h" 23 #include "ui/aura/window_tree_host.h"
24 #include "ui/display/display_switches.h" 24 #include "ui/display/display_switches.h"
25 #include "ui/message_center/message_center.h" 25 #include "ui/message_center/message_center.h"
26 #include "ui/wm/core/wm_state.h" 26 #include "ui/wm/core/wm_state.h"
27 27
28 namespace { 28 namespace {
29 29
30 // ViewEventTestPlatformPart implementation for ChromeOS (chromeos=1). 30 // ViewEventTestPlatformPart implementation for ChromeOS (chromeos=1).
31 class ViewEventTestPlatformPartChromeOS : public ViewEventTestPlatformPart { 31 class ViewEventTestPlatformPartChromeOS : public ViewEventTestPlatformPart {
32 public: 32 public:
33 explicit ViewEventTestPlatformPartChromeOS( 33 ViewEventTestPlatformPartChromeOS(
34 ui::ContextFactory* context_factory); 34 ui::ContextFactory* context_factory,
35 ui::ContextFactoryPrivate* context_factory_private);
35 ~ViewEventTestPlatformPartChromeOS() override; 36 ~ViewEventTestPlatformPartChromeOS() override;
36 37
37 // Overridden from ViewEventTestPlatformPart: 38 // Overridden from ViewEventTestPlatformPart:
38 gfx::NativeWindow GetContext() override { 39 gfx::NativeWindow GetContext() override {
39 return ash::Shell::GetPrimaryRootWindow(); 40 return ash::Shell::GetPrimaryRootWindow();
40 } 41 }
41 42
42 private: 43 private:
43 wm::WMState wm_state_; 44 wm::WMState wm_state_;
44 std::unique_ptr<aura::Env> env_; 45 std::unique_ptr<aura::Env> env_;
45 46
46 DISALLOW_COPY_AND_ASSIGN(ViewEventTestPlatformPartChromeOS); 47 DISALLOW_COPY_AND_ASSIGN(ViewEventTestPlatformPartChromeOS);
47 }; 48 };
48 49
49 ViewEventTestPlatformPartChromeOS::ViewEventTestPlatformPartChromeOS( 50 ViewEventTestPlatformPartChromeOS::ViewEventTestPlatformPartChromeOS(
50 ui::ContextFactory* context_factory) { 51 ui::ContextFactory* context_factory,
52 ui::ContextFactoryPrivate* context_factory_private) {
51 // Ash Shell can't just live on its own without a browser process, we need to 53 // Ash Shell can't just live on its own without a browser process, we need to
52 // also create the message center. 54 // also create the message center.
53 message_center::MessageCenter::Initialize(); 55 message_center::MessageCenter::Initialize();
54 chromeos::DBusThreadManager::Initialize(); 56 chromeos::DBusThreadManager::Initialize();
55 bluez::BluezDBusManager::Initialize( 57 bluez::BluezDBusManager::Initialize(
56 chromeos::DBusThreadManager::Get()->GetSystemBus(), 58 chromeos::DBusThreadManager::Get()->GetSystemBus(),
57 chromeos::DBusThreadManager::Get()->IsUsingFakes()); 59 chromeos::DBusThreadManager::Get()->IsUsingFakes());
58 chromeos::CrasAudioHandler::InitializeForTesting(); 60 chromeos::CrasAudioHandler::InitializeForTesting();
59 chromeos::NetworkHandler::Initialize(); 61 chromeos::NetworkHandler::Initialize();
60 ash::MaterialDesignController::Initialize(); 62 ash::MaterialDesignController::Initialize();
61 63
62 env_ = aura::Env::CreateInstance(); 64 env_ = aura::Env::CreateInstance();
63 ash::test::TestShellDelegate* shell_delegate = 65 ash::test::TestShellDelegate* shell_delegate =
64 new ash::test::TestShellDelegate(); 66 new ash::test::TestShellDelegate();
65 ash::ShellInitParams init_params; 67 ash::ShellInitParams init_params;
66 init_params.delegate = shell_delegate; 68 init_params.delegate = shell_delegate;
67 init_params.context_factory = context_factory; 69 init_params.context_factory = context_factory;
70 init_params.context_factory_private = context_factory_private;
68 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); 71 init_params.blocking_pool = content::BrowserThread::GetBlockingPool();
69 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 72 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
70 switches::kHostWindowBounds, "0+0-1280x800"); 73 switches::kHostWindowBounds, "0+0-1280x800");
71 ash::Shell::CreateInstance(init_params); 74 ash::Shell::CreateInstance(init_params);
72 ash::test::AshTestHelper::GetTestSessionStateDelegate()-> 75 ash::test::AshTestHelper::GetTestSessionStateDelegate()->
73 SetActiveUserSessionStarted(true); 76 SetActiveUserSessionStarted(true);
74 GetContext()->GetHost()->Show(); 77 GetContext()->GetHost()->Show();
75 } 78 }
76 79
77 ViewEventTestPlatformPartChromeOS::~ViewEventTestPlatformPartChromeOS() { 80 ViewEventTestPlatformPartChromeOS::~ViewEventTestPlatformPartChromeOS() {
78 ash::Shell::DeleteInstance(); 81 ash::Shell::DeleteInstance();
79 env_.reset(); 82 env_.reset();
80 83
81 chromeos::NetworkHandler::Shutdown(); 84 chromeos::NetworkHandler::Shutdown();
82 chromeos::CrasAudioHandler::Shutdown(); 85 chromeos::CrasAudioHandler::Shutdown();
83 bluez::BluezDBusManager::Shutdown(); 86 bluez::BluezDBusManager::Shutdown();
84 chromeos::DBusThreadManager::Shutdown(); 87 chromeos::DBusThreadManager::Shutdown();
85 // Ash Shell can't just live on its own without a browser process, we need to 88 // Ash Shell can't just live on its own without a browser process, we need to
86 // also shut down the message center. 89 // also shut down the message center.
87 message_center::MessageCenter::Shutdown(); 90 message_center::MessageCenter::Shutdown();
88 } 91 }
89 92
90 } // namespace 93 } // namespace
91 94
92 // static 95 // static
93 ViewEventTestPlatformPart* ViewEventTestPlatformPart::Create( 96 ViewEventTestPlatformPart* ViewEventTestPlatformPart::Create(
94 ui::ContextFactory* context_factory) { 97 ui::ContextFactory* context_factory,
95 return new ViewEventTestPlatformPartChromeOS(context_factory); 98 ui::ContextFactoryPrivate* context_factory_private) {
99 return new ViewEventTestPlatformPartChromeOS(context_factory,
100 context_factory_private);
96 } 101 }
OLDNEW
« no previous file with comments | « chrome/test/base/view_event_test_platform_part.h ('k') | chrome/test/base/view_event_test_platform_part_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698