diff options
author | d.halman@gmail.com <d.halman@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-21 22:04:58 +0000 |
---|---|---|
committer | d.halman@gmail.com <d.halman@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-21 22:04:58 +0000 |
commit | 179fb953f2682a75b3c271302e5b41f4e0b1c7f4 (patch) | |
tree | 1d53266110b42266b7181882f7ff763a0f962d3a /chrome/browser/extensions/extension_service.cc | |
parent | bbf6e4ea8181799b6f26f871609900fdc7b95932 (diff) | |
download | chromium_src-179fb953f2682a75b3c271302e5b41f4e0b1c7f4.zip chromium_src-179fb953f2682a75b3c271302e5b41f4e0b1c7f4.tar.gz chromium_src-179fb953f2682a75b3c271302e5b41f4e0b1c7f4.tar.bz2 |
Prompts the user whether or not to retry loading an unpacked extension if the extension failed to load.
Sends a retry notification from extension service to the settings handler on load error. The notification contains the user's response to the retry prompt.
Modified ReportError to prompt a Question box instead of a Warning box when a |user_response| is expected.
Maintains a list of all currently loading extensions. The retry notification listener is only active while extensions are in the process of loading (when the list is not empty).
BUG=338899
Review URL: https://codereview.chromium.org/167323003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258677 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_service.cc')
-rw-r--r-- | chrome/browser/extensions/extension_service.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 818dc22..a42fc1a 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -2456,10 +2456,22 @@ void ExtensionService::ReportExtensionLoadError( content::Details<const std::string>(&error)); std::string path_str = base::UTF16ToUTF8(extension_path.LossyDisplayName()); - base::string16 message = base::UTF8ToUTF16(base::StringPrintf( - "Could not load extension from '%s'. %s", - path_str.c_str(), error.c_str())); - ExtensionErrorReporter::GetInstance()->ReportError(message, be_noisy); + bool retry = false; + std::string retry_prompt; + if (be_noisy) + retry_prompt = "\n\nWould you like to retry?"; + + base::string16 message = base::UTF8ToUTF16( + base::StringPrintf("Could not load extension from '%s'. %s%s", + path_str.c_str(), + error.c_str(), + retry_prompt.c_str())); + ExtensionErrorReporter::GetInstance()->ReportError(message, be_noisy, &retry); + std::pair<bool, const base::FilePath&> details(retry, extension_path); + content::NotificationService::current()->Notify( + chrome::NOTIFICATION_EXTENSION_LOAD_RETRY, + content::Source<Profile>(profile_), + content::Details<std::pair<bool, const base::FilePath&> >(&details)); } void ExtensionService::DidCreateRenderViewForBackgroundPage( |