OLD | NEW |
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 "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller
.h" | 5 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller
.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 10 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
11 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 11 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
12 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" | 12 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" |
13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
14 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" | 14 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" |
15 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
16 #include "ui/base/base_window.h" | 16 #include "ui/base/base_window.h" |
17 | 17 |
18 ArcAppWindowLauncherItemController::ArcAppWindowLauncherItemController( | 18 ArcAppWindowLauncherItemController::ArcAppWindowLauncherItemController( |
19 const std::string& arc_app_id) | 19 const std::string& arc_app_id) |
20 : AppWindowLauncherItemController(ash::AppLaunchId(arc_app_id)) {} | 20 : AppWindowLauncherItemController(ash::ShelfID(arc_app_id)) {} |
21 | 21 |
22 ArcAppWindowLauncherItemController::~ArcAppWindowLauncherItemController() {} | 22 ArcAppWindowLauncherItemController::~ArcAppWindowLauncherItemController() {} |
23 | 23 |
24 void ArcAppWindowLauncherItemController::AddTaskId(int task_id) { | 24 void ArcAppWindowLauncherItemController::AddTaskId(int task_id) { |
25 task_ids_.insert(task_id); | 25 task_ids_.insert(task_id); |
26 } | 26 } |
27 | 27 |
28 void ArcAppWindowLauncherItemController::RemoveTaskId(int task_id) { | 28 void ArcAppWindowLauncherItemController::RemoveTaskId(int task_id) { |
29 task_ids_.erase(task_id); | 29 task_ids_.erase(task_id); |
30 } | 30 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 size_t i = std::distance(windows().begin(), it); | 68 size_t i = std::distance(windows().begin(), it); |
69 aura::Window* window = (*it)->GetNativeWindow(); | 69 aura::Window* window = (*it)->GetNativeWindow(); |
70 ash::mojom::MenuItemPtr item = ash::mojom::MenuItem::New(); | 70 ash::mojom::MenuItemPtr item = ash::mojom::MenuItem::New(); |
71 item->command_id = base::checked_cast<uint32_t>(i); | 71 item->command_id = base::checked_cast<uint32_t>(i); |
72 item->label = (window && !window->GetTitle().empty()) ? window->GetTitle() | 72 item->label = (window && !window->GetTitle().empty()) ? window->GetTitle() |
73 : app_title; | 73 : app_title; |
74 items.push_back(std::move(item)); | 74 items.push_back(std::move(item)); |
75 } | 75 } |
76 return items; | 76 return items; |
77 } | 77 } |
OLD | NEW |