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 "athena/extensions/athena_javascript_native_dialog_factory.h" | 5 #include "athena/extensions/athena_javascript_native_dialog_factory.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "components/app_modal_dialogs/javascript_dialog_manager.h" | 8 #include "components/app_modal_dialogs/javascript_dialog_manager.h" |
9 #include "components/app_modal_dialogs/javascript_native_dialog_factory.h" | 9 #include "components/app_modal_dialogs/javascript_native_dialog_factory.h" |
10 #include "components/app_modal_dialogs/views/javascript_app_modal_dialog_views.h " | 10 #include "components/app_modal_dialogs/views/javascript_app_modal_dialog_views.h " |
11 #include "components/constrained_window/constrained_window_views.h" | 11 #include "components/constrained_window/constrained_window_views.h" |
12 | 12 |
13 class JavaScriptAppModalDialog; | 13 class JavaScriptAppModalDialog; |
14 class NativeAppModalDialog; | 14 class NativeAppModalDialog; |
15 | 15 |
16 namespace athena { | 16 namespace athena { |
17 namespace { | 17 namespace { |
18 | 18 |
19 class AthenaJavaScriptNativeDialogFactory | 19 class AthenaJavaScriptNativeDialogFactory |
20 : public JavaScriptNativeDialogFactory { | 20 : public app_modal_dialogs::JavaScriptNativeDialogFactory { |
21 public: | 21 public: |
22 AthenaJavaScriptNativeDialogFactory() {} | 22 AthenaJavaScriptNativeDialogFactory() {} |
23 ~AthenaJavaScriptNativeDialogFactory() override {} | 23 ~AthenaJavaScriptNativeDialogFactory() override {} |
24 | 24 |
25 private: | 25 private: |
26 // JavScriptNativeDialogFactory: | 26 // JavScriptNativeDialogFactory: |
msw
2014/11/11 08:34:53
nit: app_modal_dialogs:: namespace in comment.
oshima
2014/11/11 18:19:48
Done.
| |
27 NativeAppModalDialog* CreateNativeJavaScriptDialog( | 27 app_modal_dialogs::NativeAppModalDialog* CreateNativeJavaScriptDialog( |
28 JavaScriptAppModalDialog* dialog, | 28 app_modal_dialogs::JavaScriptAppModalDialog* dialog, |
29 gfx::NativeWindow parent_window) override{ | 29 gfx::NativeWindow parent_window) override{ |
30 JavaScriptAppModalDialogViews* d = | 30 app_modal_dialogs::JavaScriptAppModalDialogViews* d = |
31 new JavaScriptAppModalDialogViews(dialog); | 31 new app_modal_dialogs::JavaScriptAppModalDialogViews(dialog); |
32 CreateBrowserModalDialogViews(d, parent_window); | 32 CreateBrowserModalDialogViews(d, parent_window); |
33 return d; | 33 return d; |
34 } | 34 } |
35 | 35 |
36 DISALLOW_COPY_AND_ASSIGN(AthenaJavaScriptNativeDialogFactory); | 36 DISALLOW_COPY_AND_ASSIGN(AthenaJavaScriptNativeDialogFactory); |
37 }; | 37 }; |
38 | 38 |
39 } // namespace | 39 } // namespace |
40 | 40 |
41 void InstallJavaScriptNativeDialogFactory() { | 41 void InstallJavaScriptNativeDialogFactory() { |
42 SetJavaScriptNativeDialogFactory( | 42 app_modal_dialogs::JavaScriptDialogManager::GetInstance()-> |
43 make_scoped_ptr(new AthenaJavaScriptNativeDialogFactory)); | 43 SetNativeDialogFactory( |
44 make_scoped_ptr(new AthenaJavaScriptNativeDialogFactory)); | |
44 } | 45 } |
45 | 46 |
46 } // namespace athena | 47 } // namespace athena |
OLD | NEW |