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

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

Issue 2900783003: Handle app custom icon via aura::Window property. (Closed)
Patch Set: fix mac compile Created 3 years, 6 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/display/screen_orientation_controller_chromeos.h" 8 #include "ash/display/screen_orientation_controller_chromeos.h"
9 #include "ash/public/cpp/window_properties.h" 9 #include "ash/public/cpp/window_properties.h"
10 #include "ash/shared/app_types.h" 10 #include "ash/shared/app_types.h"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 const arc::ArcAppShelfId& app_shelf_id = app_window_info.app_shelf_id(); 540 const arc::ArcAppShelfId& app_shelf_id = app_window_info.app_shelf_id();
541 const auto it = app_shelf_group_to_controller_map_.find(app_shelf_id); 541 const auto it = app_shelf_group_to_controller_map_.find(app_shelf_id);
542 if (it != app_shelf_group_to_controller_map_.end()) { 542 if (it != app_shelf_group_to_controller_map_.end()) {
543 DCHECK_EQ(it->second->app_id(), app_shelf_id.ToString()); 543 DCHECK_EQ(it->second->app_id(), app_shelf_id.ToString());
544 it->second->AddTaskId(task_id); 544 it->second->AddTaskId(task_id);
545 return it->second; 545 return it->second;
546 } 546 }
547 547
548 std::unique_ptr<ArcAppWindowLauncherItemController> controller = 548 std::unique_ptr<ArcAppWindowLauncherItemController> controller =
549 base::MakeUnique<ArcAppWindowLauncherItemController>( 549 base::MakeUnique<ArcAppWindowLauncherItemController>(
550 app_shelf_id.ToString(), owner()); 550 app_shelf_id.ToString());
551 ArcAppWindowLauncherItemController* item_controller = controller.get(); 551 ArcAppWindowLauncherItemController* item_controller = controller.get();
552 const ash::ShelfID shelf_id(app_shelf_id.ToString()); 552 const ash::ShelfID shelf_id(app_shelf_id.ToString());
553 if (!owner()->GetItem(shelf_id)) { 553 if (!owner()->GetItem(shelf_id)) {
554 owner()->CreateAppLauncherItem(std::move(controller), ash::STATUS_RUNNING); 554 owner()->CreateAppLauncherItem(std::move(controller), ash::STATUS_RUNNING);
555 } else { 555 } else {
556 owner()->shelf_model()->SetShelfItemDelegate(shelf_id, 556 owner()->shelf_model()->SetShelfItemDelegate(shelf_id,
557 std::move(controller)); 557 std::move(controller));
558 owner()->SetItemStatus(shelf_id, ash::STATUS_RUNNING); 558 owner()->SetItemStatus(shelf_id, ash::STATUS_RUNNING);
559 } 559 }
560 item_controller->AddTaskId(task_id); 560 item_controller->AddTaskId(task_id);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 const std::string* arc_app_id = exo::ShellSurface::GetApplicationId(window); 627 const std::string* arc_app_id = exo::ShellSurface::GetApplicationId(window);
628 if (!arc_app_id) 628 if (!arc_app_id)
629 return -1; 629 return -1;
630 630
631 int task_id = -1; 631 int task_id = -1;
632 if (sscanf(arc_app_id->c_str(), "org.chromium.arc.%d", &task_id) != 1) 632 if (sscanf(arc_app_id->c_str(), "org.chromium.arc.%d", &task_id) != 1)
633 return -1; 633 return -1;
634 634
635 return task_id; 635 return task_id;
636 } 636 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698