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

Unified Diff: components/app_modal_dialogs/views/javascript_app_modal_dialog_views.cc

Issue 666533007: Move JavaScriptDialogManager, JavascriptAppModalDialogViews to components/app_modal_dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 years, 1 month 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: components/app_modal_dialogs/views/javascript_app_modal_dialog_views.cc
diff --git a/chrome/browser/ui/views/javascript_app_modal_dialog_views.cc b/components/app_modal_dialogs/views/javascript_app_modal_dialog_views.cc
similarity index 78%
rename from chrome/browser/ui/views/javascript_app_modal_dialog_views.cc
rename to components/app_modal_dialogs/views/javascript_app_modal_dialog_views.cc
index 6ce5fcf741bc0ae990e7943fab6e0c47f16f3137..72e0fa2d8ad7f9916b0cfdf953371611821c3a5c 100644
--- a/chrome/browser/ui/views/javascript_app_modal_dialog_views.cc
+++ b/components/app_modal_dialogs/views/javascript_app_modal_dialog_views.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/views/javascript_app_modal_dialog_views.h"
+#include "components/app_modal_dialogs/views/javascript_app_modal_dialog_views.h"
#include "base/strings/utf_string_conversions.h"
#include "components/app_modal_dialogs/javascript_app_modal_dialog.h"
@@ -15,10 +15,6 @@
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_client_view.h"
-#if defined(USE_X11) && !defined(OS_CHROMEOS)
-#include "chrome/browser/ui/views/javascript_app_modal_event_blocker_x11.h"
-#endif
-
////////////////////////////////////////////////////////////////////////////////
// JavaScriptAppModalDialogViews, public:
@@ -55,19 +51,6 @@ int JavaScriptAppModalDialogViews::GetAppModalDialogButtons() const {
}
void JavaScriptAppModalDialogViews::ShowAppModalDialog() {
-#if defined(USE_X11) && !defined(OS_CHROMEOS)
- // BrowserView::CanActivate() ensures that other browser windows cannot be
- // activated for long while the dialog is visible. Block events to other
- // browser windows so that the user cannot interact with other browser windows
- // in the short time that the other browser windows are active. This hack is
- // unnecessary on Windows and Chrome OS.
- // TODO(pkotwicz): Find a better way of doing this and remove this hack.
- if (!event_blocker_x11_.get()) {
- event_blocker_x11_.reset(
- new JavascriptAppModalEventBlockerX11(GetWidget()->GetNativeView()));
- }
-#endif
-
GetWidget()->Show();
}
@@ -107,12 +90,6 @@ base::string16 JavaScriptAppModalDialogViews::GetWindowTitle() const {
return parent_->title();
}
-void JavaScriptAppModalDialogViews::WindowClosing() {
-#if defined(USE_X11) && !defined(OS_CHROMEOS)
- event_blocker_x11_.reset();
-#endif
-}
-
void JavaScriptAppModalDialogViews::DeleteDelegate() {
delete this;
}
@@ -174,15 +151,3 @@ views::View* JavaScriptAppModalDialogViews::GetInitiallyFocusedView() {
return message_box_view_->text_box();
return views::DialogDelegate::GetInitiallyFocusedView();
}
-
-////////////////////////////////////////////////////////////////////////////////
-// NativeAppModalDialog, public:
-
-// static
-NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt(
- JavaScriptAppModalDialog* dialog,
- gfx::NativeWindow parent_window) {
- JavaScriptAppModalDialogViews* d = new JavaScriptAppModalDialogViews(dialog);
- CreateBrowserModalDialogViews(d, parent_window);
- return d;
-}

Powered by Google App Engine
This is Rietveld 408576698