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

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

Issue 1882423004: Move shell service to toplevel shell namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/sysui_application.h ('k') | chrome/app/mash/mash_runner.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/sysui_application.h" 5 #include "ash/mus/sysui_application.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 class AshInit { 186 class AshInit {
187 public: 187 public:
188 AshInit() : worker_pool_(new base::SequencedWorkerPool(2, "AshWorkerPool")) { 188 AshInit() : worker_pool_(new base::SequencedWorkerPool(2, "AshWorkerPool")) {
189 ui::RegisterPathProvider(); 189 ui::RegisterPathProvider();
190 } 190 }
191 191
192 ~AshInit() { worker_pool_->Shutdown(); } 192 ~AshInit() { worker_pool_->Shutdown(); }
193 193
194 aura::Window* root() { return ash::Shell::GetPrimaryRootWindow(); } 194 aura::Window* root() { return ash::Shell::GetPrimaryRootWindow(); }
195 195
196 void Initialize(mojo::Connector* connector) { 196 void Initialize(::shell::Connector* connector) {
197 InitializeResourceBundle(connector); 197 InitializeResourceBundle(connector);
198 aura_init_.reset(new views::AuraInit(connector, "views_mus_resources.pak")); 198 aura_init_.reset(new views::AuraInit(connector, "views_mus_resources.pak"));
199 views::WindowManagerConnection::Create(connector); 199 views::WindowManagerConnection::Create(connector);
200 200
201 gfx::Screen* screen = gfx::Screen::GetScreen(); 201 gfx::Screen* screen = gfx::Screen::GetScreen();
202 DCHECK(screen); 202 DCHECK(screen);
203 gfx::Size size = screen->GetPrimaryDisplay().bounds().size(); 203 gfx::Size size = screen->GetPrimaryDisplay().bounds().size();
204 204
205 // Uninstall the ScreenMus installed by WindowManagerConnection, so that ash 205 // Uninstall the ScreenMus installed by WindowManagerConnection, so that ash
206 // installs and uses the ScreenAsh. This can be removed once ash learns to 206 // installs and uses the ScreenAsh. This can be removed once ash learns to
(...skipping 18 matching lines...) Expand all
225 base::Bind(&KeyboardUIMus::Create, connector); 225 base::Bind(&KeyboardUIMus::Create, connector);
226 ash::Shell::CreateInstance(init_params); 226 ash::Shell::CreateInstance(init_params);
227 ash::Shell::GetInstance()->CreateShelf(); 227 ash::Shell::GetInstance()->CreateShelf();
228 ash::Shell::GetInstance()->UpdateAfterLoginStatusChange( 228 ash::Shell::GetInstance()->UpdateAfterLoginStatusChange(
229 ash::user::LOGGED_IN_USER); 229 ash::user::LOGGED_IN_USER);
230 230
231 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); 231 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show();
232 SetupWallpaper(SkColorSetARGB(255, 0, 255, 0)); 232 SetupWallpaper(SkColorSetARGB(255, 0, 255, 0));
233 } 233 }
234 234
235 void InitializeResourceBundle(mojo::Connector* connector) { 235 void InitializeResourceBundle(::shell::Connector* connector) {
236 if (ui::ResourceBundle::HasSharedInstance()) 236 if (ui::ResourceBundle::HasSharedInstance())
237 return; 237 return;
238 238
239 std::set<std::string> resource_paths; 239 std::set<std::string> resource_paths;
240 resource_paths.insert(kResourceFileStrings); 240 resource_paths.insert(kResourceFileStrings);
241 resource_paths.insert(kResourceFile100); 241 resource_paths.insert(kResourceFile100);
242 resource_paths.insert(kResourceFile200); 242 resource_paths.insert(kResourceFile200);
243 243
244 resource_provider::ResourceLoader loader(connector, resource_paths); 244 resource_provider::ResourceLoader loader(connector, resource_paths);
245 if (!loader.BlockUntilLoaded()) 245 if (!loader.BlockUntilLoaded())
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 ShellDelegateMus* ash_delegate_ = nullptr; 295 ShellDelegateMus* ash_delegate_ = nullptr;
296 std::unique_ptr<NativeWidgetFactory> native_widget_factory_; 296 std::unique_ptr<NativeWidgetFactory> native_widget_factory_;
297 297
298 DISALLOW_COPY_AND_ASSIGN(AshInit); 298 DISALLOW_COPY_AND_ASSIGN(AshInit);
299 }; 299 };
300 300
301 SysUIApplication::SysUIApplication() {} 301 SysUIApplication::SysUIApplication() {}
302 302
303 SysUIApplication::~SysUIApplication() {} 303 SysUIApplication::~SysUIApplication() {}
304 304
305 void SysUIApplication::Initialize(mojo::Connector* connector, 305 void SysUIApplication::Initialize(::shell::Connector* connector,
306 const mojo::Identity& identity, 306 const ::shell::Identity& identity,
307 uint32_t id) { 307 uint32_t id) {
308 ash_init_.reset(new AshInit()); 308 ash_init_.reset(new AshInit());
309 ash_init_->Initialize(connector); 309 ash_init_->Initialize(connector);
310 } 310 }
311 311
312 bool SysUIApplication::AcceptConnection(mojo::Connection* connection) { 312 bool SysUIApplication::AcceptConnection(::shell::Connection* connection) {
313 connection->AddInterface<mash::shelf::mojom::ShelfController>(this); 313 connection->AddInterface<mash::shelf::mojom::ShelfController>(this);
314 return true; 314 return true;
315 } 315 }
316 316
317 void SysUIApplication::Create( 317 void SysUIApplication::Create(
318 mojo::Connection* connection, 318 ::shell::Connection* connection,
319 mojo::InterfaceRequest<mash::shelf::mojom::ShelfController> request) { 319 mojo::InterfaceRequest<mash::shelf::mojom::ShelfController> request) {
320 mash::shelf::mojom::ShelfController* shelf_controller = 320 mash::shelf::mojom::ShelfController* shelf_controller =
321 static_cast<ShelfDelegateMus*>(Shell::GetInstance()->GetShelfDelegate()); 321 static_cast<ShelfDelegateMus*>(Shell::GetInstance()->GetShelfDelegate());
322 shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request)); 322 shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request));
323 } 323 }
324 324
325 } // namespace sysui 325 } // namespace sysui
326 } // namespace ash 326 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/sysui_application.h ('k') | chrome/app/mash/mash_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698