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

Side by Side Diff: ash/mus/window_manager_application.cc

Issue 2112403002: NOSUBMIT: Initialize a StatusAreaWidget inside ash wm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « ash/mus/root_window_controller.cc ('k') | ash/system/status_area_widget.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ash/mus/window_manager_application.h" 5 #include "ash/mus/window_manager_application.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/material_design/material_design_controller.h"//JAMES
9 #include "ash/mus/accelerator_registrar_impl.h" 10 #include "ash/mus/accelerator_registrar_impl.h"
10 #include "ash/mus/root_window_controller.h" 11 #include "ash/mus/root_window_controller.h"
11 #include "ash/mus/shelf_layout_impl.h" 12 #include "ash/mus/shelf_layout_impl.h"
12 #include "ash/mus/user_window_controller_impl.h" 13 #include "ash/mus/user_window_controller_impl.h"
13 #include "ash/mus/window_manager.h" 14 #include "ash/mus/window_manager.h"
14 #include "base/bind.h" 15 #include "base/bind.h"
15 #include "base/memory/ptr_util.h" 16 #include "base/memory/ptr_util.h"
16 #include "components/mus/common/event_matcher_util.h" 17 #include "components/mus/common/event_matcher_util.h"
17 #include "components/mus/common/gpu_service.h" 18 #include "components/mus/common/gpu_service.h"
18 #include "components/mus/public/cpp/window.h" 19 #include "components/mus/public/cpp/window.h"
19 #include "components/mus/public/cpp/window_tree_client.h" 20 #include "components/mus/public/cpp/window_tree_client.h"
20 #include "services/shell/public/cpp/connection.h" 21 #include "services/shell/public/cpp/connection.h"
21 #include "services/shell/public/cpp/connector.h" 22 #include "services/shell/public/cpp/connector.h"
22 #include "services/tracing/public/cpp/tracing_impl.h" 23 #include "services/tracing/public/cpp/tracing_impl.h"
23 #include "ui/events/event.h" 24 #include "ui/events/event.h"
24 #include "ui/views/mus/aura_init.h" 25 #include "ui/views/mus/aura_init.h"
25 26
27 //JAMES
28 #include "ui/message_center/message_center.h"
29 #if defined(OS_CHROMEOS)
30 #include "chromeos/audio/cras_audio_handler.h"
31 #include "chromeos/dbus/dbus_thread_manager.h"
32 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
33 #endif
34
26 namespace ash { 35 namespace ash {
27 namespace mus { 36 namespace mus {
28 37
29 WindowManagerApplication::WindowManagerApplication() 38 WindowManagerApplication::WindowManagerApplication()
30 : connector_(nullptr), screenlock_state_listener_binding_(this) {} 39 : connector_(nullptr), screenlock_state_listener_binding_(this) {}
31 40
32 WindowManagerApplication::~WindowManagerApplication() { 41 WindowManagerApplication::~WindowManagerApplication() {
33 // AcceleratorRegistrarImpl removes an observer in its destructor. Destroy 42 // AcceleratorRegistrarImpl removes an observer in its destructor. Destroy
34 // it early on. 43 // it early on.
35 std::set<AcceleratorRegistrarImpl*> accelerator_registrars( 44 std::set<AcceleratorRegistrarImpl*> accelerator_registrars(
(...skipping 18 matching lines...) Expand all
54 } 63 }
55 64
56 void WindowManagerApplication::Initialize(shell::Connector* connector, 65 void WindowManagerApplication::Initialize(shell::Connector* connector,
57 const shell::Identity& identity, 66 const shell::Identity& identity,
58 uint32_t id) { 67 uint32_t id) {
59 connector_ = connector; 68 connector_ = connector;
60 ::mus::GpuService::Initialize(connector); 69 ::mus::GpuService::Initialize(connector);
61 window_manager_.reset(new WindowManager(connector_)); 70 window_manager_.reset(new WindowManager(connector_));
62 71
63 aura_init_.reset(new views::AuraInit(connector_, "ash_mus_resources.pak")); 72 aura_init_.reset(new views::AuraInit(connector_, "ash_mus_resources.pak"));
73 MaterialDesignController::Initialize();//JAMES
64 74
65 tracing_.Initialize(connector, identity.name()); 75 tracing_.Initialize(connector, identity.name());
66 76
67 ::mus::WindowTreeClient* window_tree_client = new ::mus::WindowTreeClient( 77 ::mus::WindowTreeClient* window_tree_client = new ::mus::WindowTreeClient(
68 window_manager_.get(), window_manager_.get(), nullptr); 78 window_manager_.get(), window_manager_.get(), nullptr);
69 window_tree_client->ConnectAsWindowManager(connector); 79 window_tree_client->ConnectAsWindowManager(connector);
70 80
81 //JAMES from sysui_application.cc InitializeComponents.
82 message_center::MessageCenter::Initialize();
83 #if defined(OS_CHROMEOS)
84 chromeos::DBusThreadManager::Initialize();
85 bluez::BluezDBusManager::Initialize(
86 chromeos::DBusThreadManager::Get()->GetSystemBus(),
87 chromeos::DBusThreadManager::Get()->IsUsingStub(
88 chromeos::DBusClientBundle::BLUETOOTH));
89 chromeos::CrasAudioHandler::InitializeForTesting();
90 #endif
91
71 InitWindowManager(window_tree_client); 92 InitWindowManager(window_tree_client);
72 } 93 }
73 94
74 bool WindowManagerApplication::AcceptConnection(shell::Connection* connection) { 95 bool WindowManagerApplication::AcceptConnection(shell::Connection* connection) {
75 connection->AddInterface<mojom::ShelfLayout>(this); 96 connection->AddInterface<mojom::ShelfLayout>(this);
76 connection->AddInterface<mojom::UserWindowController>(this); 97 connection->AddInterface<mojom::UserWindowController>(this);
77 connection->AddInterface<::mus::mojom::AcceleratorRegistrar>(this); 98 connection->AddInterface<::mus::mojom::AcceleratorRegistrar>(this);
78 if (connection->GetRemoteIdentity().name() == "mojo:mash_session") { 99 if (connection->GetRemoteIdentity().name() == "mojo:mash_session") {
79 connection->GetInterface(&session_); 100 connection->GetInterface(&session_);
80 session_->AddScreenlockStateListener( 101 session_->AddScreenlockStateListener(
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 RootWindowController* controller) { 181 RootWindowController* controller) {
161 // TODO(msw): this isn't right, ownership should belong in WindowManager 182 // TODO(msw): this isn't right, ownership should belong in WindowManager
162 // and/or RootWindowController. But this is temporary until we get rid of 183 // and/or RootWindowController. But this is temporary until we get rid of
163 // sysui. 184 // sysui.
164 shelf_layout_.reset(); 185 shelf_layout_.reset();
165 user_window_controller_.reset(); 186 user_window_controller_.reset();
166 } 187 }
167 188
168 } // namespace mus 189 } // namespace mus
169 } // namespace ash 190 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/root_window_controller.cc ('k') | ash/system/status_area_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698