Index: chrome/browser/ui/views/chrome_javascript_native_dialog_factory_views.cc |
diff --git a/chrome/browser/ui/views/chrome_javascript_native_dialog_factory_views.cc b/chrome/browser/ui/views/chrome_javascript_native_dialog_factory_views.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..38d1a80a50b224c3b542813fa89b62fc426f02f7 |
--- /dev/null |
+++ b/chrome/browser/ui/views/chrome_javascript_native_dialog_factory_views.cc |
@@ -0,0 +1,48 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
msw
2014/11/05 03:53:55
Ditto: Perhaps everything in this file could still
oshima
2014/11/05 23:22:48
This needs to stay because there is no javascript_
msw
2014/11/05 23:34:37
Acknowledged.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/ui/app_modal_dialogs/chrome_javascript_native_dialog_factory.h" |
+ |
+#include "components/app_modal_dialogs/javascript_dialog_manager.h" |
+#include "components/app_modal_dialogs/javascript_native_dialog_factory.h" |
+#include "components/app_modal_dialogs/views/javascript_app_modal_dialog_views.h" |
msw
2014/11/05 03:53:55
Should this be in an #else with the x11 header bel
oshima
2014/11/05 21:42:18
Done.
|
+#include "components/constrained_window/constrained_window_views.h" |
+#include "ui/views/widget/widget.h" |
msw
2014/11/05 03:53:55
Remove this, it's not used.
oshima
2014/11/05 21:42:18
Done.
|
+ |
+#if defined(USE_X11) && !defined(OS_CHROMEOS) |
+#include "chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.h" |
+#endif |
+ |
+namespace { |
+ |
+class ChromeJavaScriptNativeDialogViewsFactory |
+ : public JavaScriptNativeDialogFactory { |
+ public: |
+ ChromeJavaScriptNativeDialogViewsFactory() {} |
+ ~ChromeJavaScriptNativeDialogViewsFactory() override {} |
+ |
+ private: |
+ NativeAppModalDialog* CreateNativeJavaScriptDialog( |
+ JavaScriptAppModalDialog* dialog, |
+ gfx::NativeWindow parent_window) override{ |
+#if defined(USE_X11) && !defined(OS_CHROMEOS) |
+ JavaScriptAppModalDialogViews* d = |
msw
2014/11/05 03:53:55
nit: move the decl of |d| out of the pre-processor
oshima
2014/11/05 21:42:18
Done.
|
+ new JavaScriptAppModalDialogViewsX11(dialog); |
+#else |
+ JavaScriptAppModalDialogViews* d = |
+ new JavaScriptAppModalDialogViews(dialog); |
+#endif |
+ CreateAppModalDialogViews(d, parent_window); |
+ return d; |
+ } |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ChromeJavaScriptNativeDialogViewsFactory); |
+}; |
+ |
+} // namespace |
+ |
+void InstallChromeJavaScriptNativeDialogFactory() { |
+ SetJavaScriptNativeDialogFactory( |
+ make_scoped_ptr(new ChromeJavaScriptNativeDialogViewsFactory)); |
+} |