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

Side by Side Diff: chrome/browser/extensions/app_shortcut_manager.cc

Issue 11414314: App Host install should not be triggered by component extensions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/extensions/app_shortcut_manager.h" 5 #include "chrome/browser/extensions/app_shortcut_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 void AppShortcutManager::Observe(int type, 83 void AppShortcutManager::Observe(int type,
84 const content::NotificationSource& source, 84 const content::NotificationSource& source,
85 const content::NotificationDetails& details) { 85 const content::NotificationDetails& details) {
86 #if !defined(OS_MACOSX) 86 #if !defined(OS_MACOSX)
87 switch (type) { 87 switch (type) {
88 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { 88 case chrome::NOTIFICATION_EXTENSION_INSTALLED: {
89 const Extension* extension = content::Details<const Extension>( 89 const Extension* extension = content::Details<const Extension>(
90 details).ptr(); 90 details).ptr();
91 if (extension->is_platform_app()) { 91 if (extension->is_platform_app() &&
92 extension->location() != Extension::COMPONENT) {
92 #if defined(OS_WIN) 93 #if defined(OS_WIN)
93 if (BrowserDistribution::GetDistribution()->AppHostIsSupported()) { 94 if (BrowserDistribution::GetDistribution()->AppHostIsSupported()) {
94 scoped_refptr<Extension> extension_ref(const_cast<Extension*>( 95 scoped_refptr<Extension> extension_ref(const_cast<Extension*>(
95 extension)); 96 extension));
96 extensions::AppHostInstaller::EnsureAppHostInstalled( 97 extensions::AppHostInstaller::EnsureAppHostInstalled(
97 base::Bind(&AppShortcutManager::OnAppHostInstallationComplete, 98 base::Bind(&AppShortcutManager::OnAppHostInstallationComplete,
98 weak_factory_.GetWeakPtr(), extension_ref)); 99 weak_factory_.GetWeakPtr(), extension_ref));
99 } else { 100 } else {
100 UpdateApplicationShortcuts(extension); 101 UpdateApplicationShortcuts(extension);
101 } 102 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 175 }
175 176
176 void AppShortcutManager::DeleteApplicationShortcuts( 177 void AppShortcutManager::DeleteApplicationShortcuts(
177 const Extension* extension) { 178 const Extension* extension) {
178 ShellIntegration::ShortcutInfo delete_info = 179 ShellIntegration::ShortcutInfo delete_info =
179 ShortcutInfoForExtensionAndProfile(extension, profile_); 180 ShortcutInfoForExtensionAndProfile(extension, profile_);
180 web_app::DeleteAllShortcuts(delete_info); 181 web_app::DeleteAllShortcuts(delete_info);
181 } 182 }
182 183
183 } // namespace extensions 184 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698