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

Unified Diff: chrome/browser/extensions/webstore_inline_installer.cc

Issue 2391353003: Prevent inline install on fullscreen windows. (Closed)
Patch Set: Updating with reviewer commments. Created 4 years, 2 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
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 86a7848dff72637d7f3730ce8114b19ca1ed11c1..2cfb1598b28090d26b8460df9d6ba3efdcbe5071 100644
--- a/chrome/browser/extensions/webstore_inline_installer.cc
+++ b/chrome/browser/extensions/webstore_inline_installer.cc
@@ -7,6 +7,7 @@
#include "base/strings/stringprintf.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/web_contents.h"
@@ -27,6 +28,8 @@ const char kInlineInstallSupportedError[] =
"redirected to the Chrome Web Store.";
const char kInitiatedFromPopupError[] =
"Inline installs can not be initiated from pop-up windows.";
+const char kInitiatedFromFullscreenError[] =
+ "Inline installs can not be initiated from fullscreen.";
WebstoreInlineInstaller::WebstoreInlineInstaller(
content::WebContents* web_contents,
@@ -138,6 +141,12 @@ bool WebstoreInlineInstaller::CheckInlineInstallPermitted(
*error = kInitiatedFromPopupError;
return false;
}
+ FullscreenController* controller =
+ browser->exclusive_access_manager()->fullscreen_controller();
+ if (controller->IsFullscreenForBrowser() || controller->IsTabFullscreen()) {
+ *error = kInitiatedFromFullscreenError;
+ return false;
+ }
// The store may not support inline installs for this item, in which case
// we open the store-provided redirect URL in a new tab and abort the
// installation process.

Powered by Google App Engine
This is Rietveld 408576698