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

Unified Diff: chrome/browser/ui/views/ash/app_list/extension_app_item.cc

Issue 10066015: ash: Replace launcher app type with Extension launch type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/ash/app_list/extension_app_item.cc
diff --git a/chrome/browser/ui/views/ash/app_list/extension_app_item.cc b/chrome/browser/ui/views/ash/app_list/extension_app_item.cc
index f44704b54dd5d97a84a920dfc7fcc30dceef7226..0e0550e358707725e6e34f038f87d73b02e866ae 100644
--- a/chrome/browser/ui/views/ash/app_list/extension_app_item.cc
+++ b/chrome/browser/ui/views/ash/app_list/extension_app_item.cc
@@ -120,25 +120,8 @@ bool IsAppPinned(const std::string& extension_id) {
return ChromeLauncherDelegate::instance()->IsAppPinned(extension_id);
}
-void PinApp(const std::string& extension_id,
- ExtensionPrefs::LaunchType launch_type) {
- ChromeLauncherDelegate::AppType app_type =
- ChromeLauncherDelegate::APP_TYPE_TAB;
- switch (launch_type) {
- case ExtensionPrefs::LAUNCH_PINNED:
- case ExtensionPrefs::LAUNCH_REGULAR:
- app_type = ChromeLauncherDelegate::APP_TYPE_TAB;
- break;
- case ExtensionPrefs::LAUNCH_FULLSCREEN:
- case ExtensionPrefs::LAUNCH_WINDOW:
- app_type = ChromeLauncherDelegate::APP_TYPE_WINDOW;
- break;
- default:
- NOTREACHED() << "Unknown launch_type=" << launch_type;
- break;
- }
-
- ChromeLauncherDelegate::instance()->PinAppWithID(extension_id, app_type);
+void PinApp(const std::string& extension_id) {
+ ChromeLauncherDelegate::instance()->PinAppWithID(extension_id);
}
void UnpinApp(const std::string& extension_id) {
@@ -295,12 +278,10 @@ void ExtensionAppItem::ExecuteCommand(int command_id) {
if (command_id == LAUNCH) {
Activate(0);
} else if (command_id == TOGGLE_PIN) {
- if (IsAppPinned(extension_id_)) {
+ if (IsAppPinned(extension_id_))
UnpinApp(extension_id_);
- } else {
- PinApp(extension_id_,
- GetExtensionLaunchType(profile_, extension_id_));
- }
+ else
+ PinApp(extension_id_);
} else if (command_id >= LAUNCH_TYPE_START &&
command_id < LAUNCH_TYPE_LAST) {
SetExtensionLaunchType(profile_,
@@ -340,7 +321,7 @@ void ExtensionAppItem::Activate(int event_flags) {
// is set, launch as a regular tab.
extension_misc::LaunchContainer launch_container =
profile_->GetExtensionService()->extension_prefs()->GetLaunchContainer(
- extension, ExtensionPrefs::LAUNCH_REGULAR);
+ extension, ExtensionPrefs::LAUNCH_DEFAULT);
Browser::OpenApplication(
profile_, extension, launch_container, GURL(url),
« no previous file with comments | « no previous file | chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698