Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/app_modal/chrome_javascript_native_dialog_factory.h" | 5 #include "chrome/browser/ui/app_modal/chrome_javascript_native_dialog_factory.h" |
| 6 | 6 |
| 7 #include "components/app_modal/javascript_dialog_manager.h" | 7 #include "components/app_modal/javascript_dialog_manager.h" |
| 8 #include "components/app_modal/javascript_native_dialog_factory.h" | 8 #include "components/app_modal/javascript_native_dialog_factory.h" |
| 9 #include "components/constrained_window/constrained_window_views.h" | 9 #include "components/constrained_window/constrained_window_views.h" |
| 10 | 10 |
| 11 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 11 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 12 #include "chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.h" | 12 #include "chrome/browser/ui/views/javascript_app_modal_dialog_views_x11.h" |
| 13 #else | 13 #else |
| 14 #include "chrome/browser/ui/blocked_content/app_modal_dialog_helper.h" | 14 #include "chrome/browser/ui/blocked_content/app_modal_dialog_helper.h" |
| 15 #include "components/app_modal/javascript_app_modal_dialog.h" | 15 #include "components/app_modal/javascript_app_modal_dialog.h" |
| 16 #include "components/app_modal/views/javascript_app_modal_dialog_views.h" | 16 #include "components/app_modal/views/javascript_app_modal_dialog_views.h" |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 #if !defined(USE_X11) || defined(OS_CHROMEOS) | 21 #if !defined(USE_X11) || defined(OS_CHROMEOS) |
| 22 class ChromeJavaScriptAppModalDialogViews | 22 class ChromeJavaScriptAppModalDialogViews |
| 23 : public app_modal::JavaScriptAppModalDialogViews { | 23 : public app_modal::JavaScriptAppModalDialogViews { |
| 24 public: | 24 public: |
| 25 explicit ChromeJavaScriptAppModalDialogViews( | 25 explicit ChromeJavaScriptAppModalDialogViews( |
| 26 app_modal::JavaScriptAppModalDialog* parent) | 26 app_modal::JavaScriptAppModalDialog* parent) |
| 27 : app_modal::JavaScriptAppModalDialogViews(parent), | 27 : app_modal::JavaScriptAppModalDialogViews(parent), |
| 28 helper_(new AppModalDialogHelper(parent->web_contents())) {} | 28 helper_( |
| 29 new AppModalDialogHelper(parent ? parent->web_contents() : NULL)) {} | |
|
Bernhard Bauer
2014/12/22 13:18:35
nullptr
| |
| 29 virtual ~ChromeJavaScriptAppModalDialogViews() {} | 30 virtual ~ChromeJavaScriptAppModalDialogViews() {} |
| 30 | 31 |
| 31 private: | 32 private: |
| 32 scoped_ptr<AppModalDialogHelper> helper_; | 33 scoped_ptr<AppModalDialogHelper> helper_; |
| 33 | 34 |
| 34 DISALLOW_COPY_AND_ASSIGN(ChromeJavaScriptAppModalDialogViews); | 35 DISALLOW_COPY_AND_ASSIGN(ChromeJavaScriptAppModalDialogViews); |
| 35 }; | 36 }; |
| 36 #endif | 37 #endif |
| 37 | 38 |
| 38 class ChromeJavaScriptNativeDialogViewsFactory | 39 class ChromeJavaScriptNativeDialogViewsFactory |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 58 DISALLOW_COPY_AND_ASSIGN(ChromeJavaScriptNativeDialogViewsFactory); | 59 DISALLOW_COPY_AND_ASSIGN(ChromeJavaScriptNativeDialogViewsFactory); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 } // namespace | 62 } // namespace |
| 62 | 63 |
| 63 void InstallChromeJavaScriptNativeDialogFactory() { | 64 void InstallChromeJavaScriptNativeDialogFactory() { |
| 64 app_modal::JavaScriptDialogManager::GetInstance()-> | 65 app_modal::JavaScriptDialogManager::GetInstance()-> |
| 65 SetNativeDialogFactory( | 66 SetNativeDialogFactory( |
| 66 make_scoped_ptr(new ChromeJavaScriptNativeDialogViewsFactory)); | 67 make_scoped_ptr(new ChromeJavaScriptNativeDialogViewsFactory)); |
| 67 } | 68 } |
| OLD | NEW |