OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/app_list/extension_app_item.h" | 5 #include "chrome/browser/ui/app_list/extension_app_item.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/extensions/extension_prefs.h" | 8 #include "chrome/browser/extensions/extension_prefs.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_sorting.h" | 10 #include "chrome/browser/extensions/extension_sorting.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 return !is_platform_app_ && extension_id_ != extension_misc::kChromeAppId; | 95 return !is_platform_app_ && extension_id_ != extension_misc::kChromeAppId; |
96 #endif | 96 #endif |
97 } | 97 } |
98 | 98 |
99 void ExtensionAppItem::Reload() { | 99 void ExtensionAppItem::Reload() { |
100 const Extension* extension = GetExtension(); | 100 const Extension* extension = GetExtension(); |
101 bool is_installing = !extension; | 101 bool is_installing = !extension; |
102 SetIsInstalling(is_installing); | 102 SetIsInstalling(is_installing); |
103 set_app_id(extension_id_); | 103 set_app_id(extension_id_); |
104 if (is_installing) { | 104 if (is_installing) { |
105 SetTitle(extension_name_); | 105 SetTitleAndFullName(extension_name_, extension_name_); |
106 UpdateIcon(); | 106 UpdateIcon(); |
107 return; | 107 return; |
108 } | 108 } |
109 SetTitle(extension->name()); | 109 SetTitleAndFullName(extension->short_name(), extension->name()); |
110 LoadImage(extension); | 110 LoadImage(extension); |
111 } | 111 } |
112 | 112 |
113 syncer::StringOrdinal ExtensionAppItem::GetPageOrdinal() const { | 113 syncer::StringOrdinal ExtensionAppItem::GetPageOrdinal() const { |
114 return GetExtensionSorting(profile_)->GetPageOrdinal(extension_id_); | 114 return GetExtensionSorting(profile_)->GetPageOrdinal(extension_id_); |
115 } | 115 } |
116 | 116 |
117 syncer::StringOrdinal ExtensionAppItem::GetAppLaunchOrdinal() const { | 117 syncer::StringOrdinal ExtensionAppItem::GetAppLaunchOrdinal() const { |
118 return GetExtensionSorting(profile_)->GetAppLaunchOrdinal(extension_id_); | 118 return GetExtensionSorting(profile_)->GetAppLaunchOrdinal(extension_id_); |
119 } | 119 } |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 context_menu_.reset(new app_list::AppContextMenu( | 267 context_menu_.reset(new app_list::AppContextMenu( |
268 this, profile_, extension_id_, controller_, is_platform_app_)); | 268 this, profile_, extension_id_, controller_, is_platform_app_)); |
269 } | 269 } |
270 | 270 |
271 return context_menu_->GetMenuModel(); | 271 return context_menu_->GetMenuModel(); |
272 } | 272 } |
273 | 273 |
274 void ExtensionAppItem::ExecuteLaunchCommand(int event_flags) { | 274 void ExtensionAppItem::ExecuteLaunchCommand(int event_flags) { |
275 Launch(event_flags); | 275 Launch(event_flags); |
276 } | 276 } |
OLD | NEW |