Chromium Code Reviews| 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 SetTitle(extension_name_); |
|
benwells
2013/08/29 09:14:15
This will be the full name. Are you planning on fi
tmdiep
2013/08/30 02:48:13
Does this need to be handled? I see that when the
| |
| 106 SetFullName(extension_name_); | |
| 106 UpdateIcon(); | 107 UpdateIcon(); |
| 107 return; | 108 return; |
| 108 } | 109 } |
| 109 SetTitle(extension->name()); | 110 SetTitle(extension->short_name()); |
| 111 SetFullName(extension->name()); | |
| 110 LoadImage(extension); | 112 LoadImage(extension); |
| 111 } | 113 } |
| 112 | 114 |
| 113 syncer::StringOrdinal ExtensionAppItem::GetPageOrdinal() const { | 115 syncer::StringOrdinal ExtensionAppItem::GetPageOrdinal() const { |
| 114 return GetExtensionSorting(profile_)->GetPageOrdinal(extension_id_); | 116 return GetExtensionSorting(profile_)->GetPageOrdinal(extension_id_); |
| 115 } | 117 } |
| 116 | 118 |
| 117 syncer::StringOrdinal ExtensionAppItem::GetAppLaunchOrdinal() const { | 119 syncer::StringOrdinal ExtensionAppItem::GetAppLaunchOrdinal() const { |
| 118 return GetExtensionSorting(profile_)->GetAppLaunchOrdinal(extension_id_); | 120 return GetExtensionSorting(profile_)->GetAppLaunchOrdinal(extension_id_); |
| 119 } | 121 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 267 context_menu_.reset(new app_list::AppContextMenu( | 269 context_menu_.reset(new app_list::AppContextMenu( |
| 268 this, profile_, extension_id_, controller_, is_platform_app_)); | 270 this, profile_, extension_id_, controller_, is_platform_app_)); |
| 269 } | 271 } |
| 270 | 272 |
| 271 return context_menu_->GetMenuModel(); | 273 return context_menu_->GetMenuModel(); |
| 272 } | 274 } |
| 273 | 275 |
| 274 void ExtensionAppItem::ExecuteLaunchCommand(int event_flags) { | 276 void ExtensionAppItem::ExecuteLaunchCommand(int event_flags) { |
| 275 Launch(event_flags); | 277 Launch(event_flags); |
| 276 } | 278 } |
| OLD | NEW |