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

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

Issue 2791803002: mash: Move LauncherItemController to ash, rename ShelfItemDelegate. (Closed)
Patch Set: Move shelf_item_delegate to ash/public/cpp, 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 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" 4 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h"
5 5
6 #include <string> 6 #include <string>
7 7
8 #include "ash/common/shelf/shelf_delegate.h" 8 #include "ash/common/shelf/shelf_delegate.h"
9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 const AppWindowInfo& app_window_info) { 635 const AppWindowInfo& app_window_info) {
636 const arc::ArcAppShelfId& app_shelf_id = app_window_info.app_shelf_id(); 636 const arc::ArcAppShelfId& app_shelf_id = app_window_info.app_shelf_id();
637 const auto it = app_shelf_group_to_controller_map_.find(app_shelf_id); 637 const auto it = app_shelf_group_to_controller_map_.find(app_shelf_id);
638 if (it != app_shelf_group_to_controller_map_.end()) { 638 if (it != app_shelf_group_to_controller_map_.end()) {
639 DCHECK_EQ(it->second->app_id(), app_shelf_id.ToString()); 639 DCHECK_EQ(it->second->app_id(), app_shelf_id.ToString());
640 it->second->AddTaskId(task_id); 640 it->second->AddTaskId(task_id);
641 return it->second; 641 return it->second;
642 } 642 }
643 643
644 ArcAppWindowLauncherItemController* controller = 644 ArcAppWindowLauncherItemController* controller =
645 new ArcAppWindowLauncherItemController(app_shelf_id.ToString(), owner()); 645 new ArcAppWindowLauncherItemController(app_shelf_id.ToString());
646 const ash::ShelfID shelf_id = 646 const ash::ShelfID shelf_id =
647 shelf_delegate_->GetShelfIDForAppID(app_shelf_id.ToString()); 647 shelf_delegate_->GetShelfIDForAppID(app_shelf_id.ToString());
648 if (!shelf_id) { 648 if (!shelf_id) {
649 owner()->CreateAppLauncherItem(controller, ash::STATUS_RUNNING); 649 owner()->CreateAppLauncherItem(controller, ash::STATUS_RUNNING);
650 } else { 650 } else {
651 owner()->SetItemController(shelf_id, controller); 651 owner()->SetItemController(shelf_id, controller);
652 owner()->SetItemStatus(shelf_id, ash::STATUS_RUNNING); 652 owner()->SetItemStatus(shelf_id, ash::STATUS_RUNNING);
653 } 653 }
654 controller->AddTaskId(task_id); 654 controller->AddTaskId(task_id);
655 app_shelf_group_to_controller_map_[app_shelf_id] = controller; 655 app_shelf_group_to_controller_map_[app_shelf_id] = controller;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window); 721 const std::string arc_app_id = exo::ShellSurface::GetApplicationId(window);
722 if (arc_app_id.empty()) 722 if (arc_app_id.empty())
723 return -1; 723 return -1;
724 724
725 int task_id = -1; 725 int task_id = -1;
726 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1) 726 if (sscanf(arc_app_id.c_str(), "org.chromium.arc.%d", &task_id) != 1)
727 return -1; 727 return -1;
728 728
729 return task_id; 729 return task_id;
730 } 730 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698