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

Side by Side Diff: chrome/browser/download/download_crx_util.cc

Issue 10699057: Move application creation and extension install prompt showing off Browser and onto ExtensionTabHel… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
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 // Download code which handles CRX files (extensions, themes, apps, ...). 5 // Download code which handles CRX files (extensions, themes, apps, ...).
6 6
7 #include "chrome/browser/download/download_util.h" 7 #include "chrome/browser/download/download_util.h"
8 #include "chrome/browser/extensions/crx_installer.h" 8 #include "chrome/browser/extensions/crx_installer.h"
9 #include "chrome/browser/extensions/extension_install_prompt.h" 9 #include "chrome/browser/extensions/extension_install_prompt.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 22 matching lines...) Expand all
33 // to set one. 33 // to set one.
34 ExtensionInstallPrompt* CreateExtensionInstallPrompt(Profile* profile) { 34 ExtensionInstallPrompt* CreateExtensionInstallPrompt(Profile* profile) {
35 // Use a mock if one is present. Otherwise, create a real extensions 35 // Use a mock if one is present. Otherwise, create a real extensions
36 // install UI. 36 // install UI.
37 ExtensionInstallPrompt* result = NULL; 37 ExtensionInstallPrompt* result = NULL;
38 if (mock_install_prompt_for_testing) { 38 if (mock_install_prompt_for_testing) {
39 result = mock_install_prompt_for_testing; 39 result = mock_install_prompt_for_testing;
40 mock_install_prompt_for_testing = NULL; 40 mock_install_prompt_for_testing = NULL;
41 } else { 41 } else {
42 Browser* browser = browser::FindLastActiveWithProfile(profile); 42 Browser* browser = browser::FindLastActiveWithProfile(profile);
43 result = new ExtensionInstallPrompt(browser); 43 result = chrome::CreateExtensionInstallPromptWithBrowser(browser);
44 } 44 }
45 45
46 return result; 46 return result;
47 } 47 }
48 48
49 bool OffStoreInstallAllowedByPrefs(Profile* profile, const DownloadItem& item) { 49 bool OffStoreInstallAllowedByPrefs(Profile* profile, const DownloadItem& item) {
50 ExtensionPrefs* prefs = 50 ExtensionPrefs* prefs =
51 ExtensionSystem::Get(profile)->extension_service()->extension_prefs(); 51 ExtensionSystem::Get(profile)->extension_service()->extension_prefs();
52 CHECK(prefs); 52 CHECK(prefs);
53 53
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 if (download_item.GetMimeType() == extensions::Extension::kMimeType || 118 if (download_item.GetMimeType() == extensions::Extension::kMimeType ||
119 UserScript::IsURLUserScript(download_item.GetURL(), 119 UserScript::IsURLUserScript(download_item.GetURL(),
120 download_item.GetMimeType())) { 120 download_item.GetMimeType())) {
121 return true; 121 return true;
122 } else { 122 } else {
123 return false; 123 return false;
124 } 124 }
125 } 125 }
126 126
127 } // namespace download_crx_util 127 } // namespace download_crx_util
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/extensions/api/identity/identity_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698