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 "components/app_modal/javascript_dialog_manager.h" | 5 #include "components/app_modal/javascript_dialog_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "components/app_modal/app_modal_dialog.h" | 10 #include "components/app_modal/app_modal_dialog.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 return extra_data->has_already_shown_a_dialog_; | 45 return extra_data->has_already_shown_a_dialog_; |
46 } | 46 } |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 //////////////////////////////////////////////////////////////////////////////// | 50 //////////////////////////////////////////////////////////////////////////////// |
51 // JavaScriptDialogManager, public: | 51 // JavaScriptDialogManager, public: |
52 | 52 |
53 // static | 53 // static |
54 JavaScriptDialogManager* JavaScriptDialogManager::GetInstance() { | 54 JavaScriptDialogManager* JavaScriptDialogManager::GetInstance() { |
55 return Singleton<JavaScriptDialogManager>::get(); | 55 return base::Singleton<JavaScriptDialogManager>::get(); |
56 } | 56 } |
57 | 57 |
58 void JavaScriptDialogManager::SetNativeDialogFactory( | 58 void JavaScriptDialogManager::SetNativeDialogFactory( |
59 scoped_ptr<JavaScriptNativeDialogFactory> factory) { | 59 scoped_ptr<JavaScriptNativeDialogFactory> factory) { |
60 native_dialog_factory_ = factory.Pass(); | 60 native_dialog_factory_ = factory.Pass(); |
61 } | 61 } |
62 | 62 |
63 void JavaScriptDialogManager::SetExtensionsClient( | 63 void JavaScriptDialogManager::SetExtensionsClient( |
64 scoped_ptr<JavaScriptDialogExtensionsClient> extensions_client) { | 64 scoped_ptr<JavaScriptDialogExtensionsClient> extensions_client) { |
65 extensions_client_ = extensions_client.Pass(); | 65 extensions_client_ = extensions_client.Pass(); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 const base::string16& user_input) { | 238 const base::string16& user_input) { |
239 // If an extension opened this dialog then the extension may shut down its | 239 // If an extension opened this dialog then the extension may shut down its |
240 // lazy background page after the dialog closes. (Dialogs are closed before | 240 // lazy background page after the dialog closes. (Dialogs are closed before |
241 // their WebContents is destroyed so |web_contents| is still valid here.) | 241 // their WebContents is destroyed so |web_contents| is still valid here.) |
242 extensions_client_->OnDialogClosed(web_contents); | 242 extensions_client_->OnDialogClosed(web_contents); |
243 | 243 |
244 callback.Run(success, user_input); | 244 callback.Run(success, user_input); |
245 } | 245 } |
246 | 246 |
247 } // namespace app_modal | 247 } // namespace app_modal |
OLD | NEW |