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

Unified Diff: third_party/WebKit/Source/web/ChromeClientImpl.cpp

Issue 2885033007: Disable color/date chooser in VR mode via WebPreferences (Closed)
Patch Set: added explanatory comment. Created 3 years, 7 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: third_party/WebKit/Source/web/ChromeClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
index c79411f624b46d380f2a21a996ae61368df5c3d1..49bb92eac40848d2c2a40eaf977880c70ead3eb0 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -50,6 +50,7 @@
#include "core/html/forms/ColorChooser.h"
#include "core/html/forms/ColorChooserClient.h"
#include "core/html/forms/DateTimeChooser.h"
+#include "core/html/forms/DateTimeChooserClient.h"
#include "core/layout/HitTestResult.h"
#include "core/layout/LayoutPart.h"
#include "core/layout/compositing/CompositedSelection.h"
@@ -705,6 +706,10 @@ ColorChooser* ChromeClientImpl::OpenColorChooser(
const Color&) {
NotifyPopupOpeningObservers();
ColorChooserUIController* controller = nullptr;
+
+ if (frame->GetDocument()->GetSettings()->GetPagePopupsSuppressed())
+ return nullptr;
+
if (RuntimeEnabledFeatures::pagePopupEnabled())
controller =
ColorChooserPopupUIController::Create(frame, this, chooser_client);
@@ -717,6 +722,12 @@ ColorChooser* ChromeClientImpl::OpenColorChooser(
DateTimeChooser* ChromeClientImpl::OpenDateTimeChooser(
DateTimeChooserClient* picker_client,
const DateTimeChooserParameters& parameters) {
+ if (picker_client->OwnerElement()
+ .GetDocument()
+ .GetSettings()
+ ->GetPagePopupsSuppressed())
+ return nullptr;
+
NotifyPopupOpeningObservers();
if (RuntimeEnabledFeatures::inputMultipleFieldsUIEnabled())
return DateTimeChooserImpl::Create(this, picker_client, parameters);
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/DateTimeChooserClient.h ('k') | third_party/WebKit/Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698