Chromium Code Reviews| Index: chrome/browser/extensions/webstore_inline_installer.cc |
| diff --git a/chrome/browser/extensions/webstore_inline_installer.cc b/chrome/browser/extensions/webstore_inline_installer.cc |
| index 9e992bcb64fc1bedc00a3d598de8f3acc041de6b..816022adf34ec9e1e55691eaf1aaef1c9b521733 100644 |
| --- a/chrome/browser/extensions/webstore_inline_installer.cc |
| +++ b/chrome/browser/extensions/webstore_inline_installer.cc |
| @@ -30,6 +30,7 @@ const char kInitiatedFromPopupError[] = |
| "Inline installs can not be initiated from pop-up windows."; |
| const char kInitiatedFromFullscreenError[] = |
| "Inline installs can not be initiated from fullscreen."; |
| +const char kInternalError[] = "Unable to complete installation."; |
| WebstoreInlineInstaller::WebstoreInlineInstaller( |
| content::WebContents* web_contents, |
| @@ -136,7 +137,10 @@ bool WebstoreInlineInstaller::CheckInlineInstallPermitted( |
| const base::DictionaryValue& webstore_data, |
| std::string* error) const { |
| Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); |
| - DCHECK(browser); |
| + if (!browser) { |
|
Devlin
2017/01/31 20:18:47
Hmm... interesting. Do you know when this might h
robertshield
2017/02/01 14:21:32
Yes, I believe in this case, web_contents() is not
Devlin
2017/02/06 16:28:41
Hmm, okay. What about merging this logic with Che
robertshield
2017/02/10 15:25:23
That does seem better. Made it so. Apologies for t
|
| + *error = kInternalError; |
| + return false; |
| + } |
| if (browser->is_type_popup()) { |
| *error = kInitiatedFromPopupError; |
| return false; |