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

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

Issue 2627533002: Replace ShelfItemDelegate::GetTitle() with ShelfItem::title. (Closed)
Patch Set: Address comments. Created 3 years, 11 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 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 19 matching lines...) Expand all
30 30
31 base::TimeDelta ArcAppDeferredLauncherItemController::GetActiveTime() const { 31 base::TimeDelta ArcAppDeferredLauncherItemController::GetActiveTime() const {
32 return base::Time::Now() - start_time_; 32 return base::Time::Now() - start_time_;
33 } 33 }
34 34
35 ash::ShelfItemDelegate::PerformedAction 35 ash::ShelfItemDelegate::PerformedAction
36 ArcAppDeferredLauncherItemController::ItemSelected(const ui::Event& event) { 36 ArcAppDeferredLauncherItemController::ItemSelected(const ui::Event& event) {
37 return ash::ShelfItemDelegate::kNoAction; 37 return ash::ShelfItemDelegate::kNoAction;
38 } 38 }
39 39
40 base::string16 ArcAppDeferredLauncherItemController::GetTitle() {
41 ArcAppListPrefs* arc_prefs =
42 ArcAppListPrefs::Get(launcher_controller()->profile());
43 DCHECK(arc_prefs);
44 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = arc_prefs->GetApp(
45 ArcAppWindowLauncherController::GetArcAppIdFromShelfAppId(app_id()));
46 if (!app_info) {
47 NOTREACHED();
48 return base::string16();
49 }
50
51 return base::UTF8ToUTF16(app_info->name);
52 }
53
54 ash::ShelfMenuModel* 40 ash::ShelfMenuModel*
55 ArcAppDeferredLauncherItemController::CreateApplicationMenu(int event_flags) { 41 ArcAppDeferredLauncherItemController::CreateApplicationMenu(int event_flags) {
56 return nullptr; 42 return nullptr;
57 } 43 }
58 44
59 void ArcAppDeferredLauncherItemController::Close() { 45 void ArcAppDeferredLauncherItemController::Close() {
60 if (host_) 46 if (host_)
61 host_->Close(app_id()); 47 host_->Close(app_id());
62 } 48 }
63 49
64 bool ArcAppDeferredLauncherItemController::IsVisible() const { 50 bool ArcAppDeferredLauncherItemController::IsVisible() const {
65 return true; 51 return true;
66 } 52 }
67 53
68 void ArcAppDeferredLauncherItemController::Launch(ash::LaunchSource source, 54 void ArcAppDeferredLauncherItemController::Launch(ash::LaunchSource source,
69 int event_flags) {} 55 int event_flags) {}
70 56
71 ash::ShelfItemDelegate::PerformedAction 57 ash::ShelfItemDelegate::PerformedAction
72 ArcAppDeferredLauncherItemController::Activate(ash::LaunchSource source) { 58 ArcAppDeferredLauncherItemController::Activate(ash::LaunchSource source) {
73 return ash::ShelfItemDelegate::kNoAction; 59 return ash::ShelfItemDelegate::kNoAction;
74 } 60 }
75 61
76 ChromeLauncherAppMenuItems 62 ChromeLauncherAppMenuItems
77 ArcAppDeferredLauncherItemController::GetApplicationList(int event_flags) { 63 ArcAppDeferredLauncherItemController::GetApplicationList(int event_flags) {
78 return ChromeLauncherAppMenuItems(); 64 return ChromeLauncherAppMenuItems();
79 } 65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698