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

Side by Side Diff: chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc

Issue 2798173002: mash: Remove ChromeLauncherController's |id_to_item_controller_map_|. (Closed)
Patch Set: Remove get|set delegate helpers; cleanup. Created 3 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
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/common/shelf/shelf_delegate.h" 5 #include "ash/common/shelf/shelf_delegate.h"
6 #include "ash/public/cpp/shelf_item_delegate.h" 6 #include "ash/public/cpp/shelf_item_delegate.h"
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/window_util.h" 8 #include "ash/wm/window_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 app_instance_observer()->OnInstanceReady(); 252 app_instance_observer()->OnInstanceReady();
253 } 253 }
254 254
255 void StopInstance() { 255 void StopInstance() {
256 arc_session_manager()->Shutdown(); 256 arc_session_manager()->Shutdown();
257 app_instance_observer()->OnInstanceClosed(); 257 app_instance_observer()->OnInstanceClosed();
258 } 258 }
259 259
260 ash::ShelfItemDelegate* GetAppItemController(const std::string& id) { 260 ash::ShelfItemDelegate* GetAppItemController(const std::string& id) {
261 const ash::ShelfID shelf_id = shelf_delegate()->GetShelfIDForAppID(id); 261 const ash::ShelfID shelf_id = shelf_delegate()->GetShelfIDForAppID(id);
262 if (!shelf_id) 262 return ash::Shell::Get()->shelf_model()->GetShelfItemDelegate(shelf_id);
263 return nullptr;
264 return chrome_controller()->GetShelfItemDelegate(shelf_id);
265 } 263 }
266 264
267 ArcAppListPrefs* app_prefs() { return ArcAppListPrefs::Get(profile()); } 265 ArcAppListPrefs* app_prefs() { return ArcAppListPrefs::Get(profile()); }
268 266
269 // Returns as AppHost interface in order to access to private implementation 267 // Returns as AppHost interface in order to access to private implementation
270 // of the interface. 268 // of the interface.
271 arc::mojom::AppHost* app_host() { return app_prefs(); } 269 arc::mojom::AppHost* app_host() { return app_prefs(); }
272 270
273 // Returns as AppInstance observer interface in order to access to private 271 // Returns as AppInstance observer interface in order to access to private
274 // implementation of the interface. 272 // implementation of the interface.
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 app_host()->OnTaskDestroyed(2); 544 app_host()->OnTaskDestroyed(2);
547 EXPECT_EQ(controller2, GetAppItemController(shelf_id2)); 545 EXPECT_EQ(controller2, GetAppItemController(shelf_id2));
548 // Destroy task #2, this kills shelf group 2 546 // Destroy task #2, this kills shelf group 2
549 app_host()->OnTaskDestroyed(3); 547 app_host()->OnTaskDestroyed(3);
550 EXPECT_FALSE(GetAppItemController(shelf_id2)); 548 EXPECT_FALSE(GetAppItemController(shelf_id2));
551 549
552 // Disable ARC, this removes app and as result kills shelf group 3. 550 // Disable ARC, this removes app and as result kills shelf group 3.
553 arc::SetArcPlayStoreEnabledForProfile(profile(), false); 551 arc::SetArcPlayStoreEnabledForProfile(profile(), false);
554 EXPECT_FALSE(GetAppItemController(shelf_id3)); 552 EXPECT_FALSE(GetAppItemController(shelf_id3));
555 } 553 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698