| 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_deferred_launcher_item_controll
er.h" | 5 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_item_controll
er.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = arc_prefs->GetApp( | 44 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = arc_prefs->GetApp( |
| 45 ArcAppWindowLauncherController::GetArcAppIdFromShelfAppId(app_id())); | 45 ArcAppWindowLauncherController::GetArcAppIdFromShelfAppId(app_id())); |
| 46 if (!app_info) { | 46 if (!app_info) { |
| 47 NOTREACHED(); | 47 NOTREACHED(); |
| 48 return base::string16(); | 48 return base::string16(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 return base::UTF8ToUTF16(app_info->name); | 51 return base::UTF8ToUTF16(app_info->name); |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool ArcAppDeferredLauncherItemController::CanPin() const { | |
| 55 return true; | |
| 56 } | |
| 57 | |
| 58 ash::ShelfMenuModel* | 54 ash::ShelfMenuModel* |
| 59 ArcAppDeferredLauncherItemController::CreateApplicationMenu(int event_flags) { | 55 ArcAppDeferredLauncherItemController::CreateApplicationMenu(int event_flags) { |
| 60 return nullptr; | 56 return nullptr; |
| 61 } | 57 } |
| 62 | 58 |
| 63 void ArcAppDeferredLauncherItemController::Close() { | 59 void ArcAppDeferredLauncherItemController::Close() { |
| 64 if (host_) | 60 if (host_) |
| 65 host_->Close(app_id()); | 61 host_->Close(app_id()); |
| 66 } | 62 } |
| 67 | 63 |
| 68 bool ArcAppDeferredLauncherItemController::IsVisible() const { | 64 bool ArcAppDeferredLauncherItemController::IsVisible() const { |
| 69 return true; | 65 return true; |
| 70 } | 66 } |
| 71 | 67 |
| 72 void ArcAppDeferredLauncherItemController::Launch(ash::LaunchSource source, | 68 void ArcAppDeferredLauncherItemController::Launch(ash::LaunchSource source, |
| 73 int event_flags) {} | 69 int event_flags) {} |
| 74 | 70 |
| 75 ash::ShelfItemDelegate::PerformedAction | 71 ash::ShelfItemDelegate::PerformedAction |
| 76 ArcAppDeferredLauncherItemController::Activate(ash::LaunchSource source) { | 72 ArcAppDeferredLauncherItemController::Activate(ash::LaunchSource source) { |
| 77 return ash::ShelfItemDelegate::kNoAction; | 73 return ash::ShelfItemDelegate::kNoAction; |
| 78 } | 74 } |
| 79 | 75 |
| 80 ChromeLauncherAppMenuItems | 76 ChromeLauncherAppMenuItems |
| 81 ArcAppDeferredLauncherItemController::GetApplicationList(int event_flags) { | 77 ArcAppDeferredLauncherItemController::GetApplicationList(int event_flags) { |
| 82 return ChromeLauncherAppMenuItems(); | 78 return ChromeLauncherAppMenuItems(); |
| 83 } | 79 } |
| OLD | NEW |