| 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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 9 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 10 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" | 10 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" |
| 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h" | 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h" |
| 12 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 12 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 13 #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" | 13 #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" |
| 14 #include "ui/aura/window.h" |
| 15 #include "ui/base/base_window.h" |
| 14 | 16 |
| 15 ArcAppWindowLauncherItemController::ArcAppWindowLauncherItemController( | 17 ArcAppWindowLauncherItemController::ArcAppWindowLauncherItemController( |
| 16 const std::string& arc_app_id, | 18 const std::string& arc_app_id, |
| 17 ChromeLauncherController* controller) | 19 ChromeLauncherController* controller) |
| 18 : AppWindowLauncherItemController(TYPE_APP, | 20 : AppWindowLauncherItemController(TYPE_APP, |
| 19 arc_app_id, | 21 arc_app_id, |
| 20 arc_app_id, | 22 arc_app_id, |
| 21 controller) {} | 23 controller) {} |
| 22 | 24 |
| 23 ArcAppWindowLauncherItemController::~ArcAppWindowLauncherItemController() {} | 25 ArcAppWindowLauncherItemController::~ArcAppWindowLauncherItemController() {} |
| (...skipping 14 matching lines...) Expand all Loading... |
| 38 | 40 |
| 39 ash::ShelfMenuModel* ArcAppWindowLauncherItemController::CreateApplicationMenu( | 41 ash::ShelfMenuModel* ArcAppWindowLauncherItemController::CreateApplicationMenu( |
| 40 int event_flags) { | 42 int event_flags) { |
| 41 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); | 43 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); |
| 42 } | 44 } |
| 43 | 45 |
| 44 ChromeLauncherAppMenuItems | 46 ChromeLauncherAppMenuItems |
| 45 ArcAppWindowLauncherItemController::GetApplicationList(int event_flags) { | 47 ArcAppWindowLauncherItemController::GetApplicationList(int event_flags) { |
| 46 ChromeLauncherAppMenuItems items = | 48 ChromeLauncherAppMenuItems items = |
| 47 AppWindowLauncherItemController::GetApplicationList(event_flags); | 49 AppWindowLauncherItemController::GetApplicationList(event_flags); |
| 48 for (size_t i = 0; i < windows().size(); ++i) { | 50 size_t i = 0; |
| 51 for (auto it = windows().begin(); it != windows().end(); ++it, ++i) { |
| 49 // TODO(khmel): resolve correct icon here. | 52 // TODO(khmel): resolve correct icon here. |
| 50 gfx::Image image; | 53 gfx::Image image; |
| 54 aura::Window* window = (*it)->GetNativeWindow(); |
| 51 items.push_back(new ChromeLauncherAppMenuItemV2App( | 55 items.push_back(new ChromeLauncherAppMenuItemV2App( |
| 52 GetTitle(), &image, app_id(), launcher_controller(), i, | 56 (window ? window->title() : GetTitle()), &image, app_id(), |
| 53 i == 0 /* has_leading_separator */)); | 57 launcher_controller(), i, i == 0 /* has_leading_separator */)); |
| 54 } | 58 } |
| 55 return items; | 59 return items; |
| 56 } | 60 } |
| OLD | NEW |