OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_dialogs/javascript_dialog_manager.h" | 5 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 static ChromeJavaScriptDialogManager* GetInstance(); | 89 static ChromeJavaScriptDialogManager* GetInstance(); |
90 | 90 |
91 virtual void RunJavaScriptDialog( | 91 virtual void RunJavaScriptDialog( |
92 WebContents* web_contents, | 92 WebContents* web_contents, |
93 const GURL& origin_url, | 93 const GURL& origin_url, |
94 const std::string& accept_lang, | 94 const std::string& accept_lang, |
95 content::JavaScriptMessageType message_type, | 95 content::JavaScriptMessageType message_type, |
96 const base::string16& message_text, | 96 const base::string16& message_text, |
97 const base::string16& default_prompt_text, | 97 const base::string16& default_prompt_text, |
98 const DialogClosedCallback& callback, | 98 const DialogClosedCallback& callback, |
99 bool* did_suppress_message) OVERRIDE; | 99 bool* did_suppress_message) override; |
100 | 100 |
101 virtual void RunBeforeUnloadDialog( | 101 virtual void RunBeforeUnloadDialog( |
102 WebContents* web_contents, | 102 WebContents* web_contents, |
103 const base::string16& message_text, | 103 const base::string16& message_text, |
104 bool is_reload, | 104 bool is_reload, |
105 const DialogClosedCallback& callback) OVERRIDE; | 105 const DialogClosedCallback& callback) override; |
106 | 106 |
107 virtual bool HandleJavaScriptDialog( | 107 virtual bool HandleJavaScriptDialog( |
108 WebContents* web_contents, | 108 WebContents* web_contents, |
109 bool accept, | 109 bool accept, |
110 const base::string16* prompt_override) OVERRIDE; | 110 const base::string16* prompt_override) override; |
111 | 111 |
112 virtual void CancelActiveAndPendingDialogs( | 112 virtual void CancelActiveAndPendingDialogs( |
113 WebContents* web_contents) OVERRIDE; | 113 WebContents* web_contents) override; |
114 | 114 |
115 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; | 115 virtual void WebContentsDestroyed(WebContents* web_contents) override; |
116 | 116 |
117 private: | 117 private: |
118 friend struct DefaultSingletonTraits<ChromeJavaScriptDialogManager>; | 118 friend struct DefaultSingletonTraits<ChromeJavaScriptDialogManager>; |
119 | 119 |
120 ChromeJavaScriptDialogManager(); | 120 ChromeJavaScriptDialogManager(); |
121 virtual ~ChromeJavaScriptDialogManager(); | 121 virtual ~ChromeJavaScriptDialogManager(); |
122 | 122 |
123 base::string16 GetTitle(WebContents* web_contents, | 123 base::string16 GetTitle(WebContents* web_contents, |
124 const GURL& origin_url, | 124 const GURL& origin_url, |
125 const std::string& accept_lang, | 125 const std::string& accept_lang, |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 DecrementLazyKeepaliveCount(web_contents); | 317 DecrementLazyKeepaliveCount(web_contents); |
318 | 318 |
319 callback.Run(success, user_input); | 319 callback.Run(success, user_input); |
320 } | 320 } |
321 | 321 |
322 } // namespace | 322 } // namespace |
323 | 323 |
324 content::JavaScriptDialogManager* GetJavaScriptDialogManagerInstance() { | 324 content::JavaScriptDialogManager* GetJavaScriptDialogManagerInstance() { |
325 return ChromeJavaScriptDialogManager::GetInstance(); | 325 return ChromeJavaScriptDialogManager::GetInstance(); |
326 } | 326 } |
OLD | NEW |