| 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 "components/app_modal/javascript_app_modal_dialog.h" | 5 #include "components/app_modal/javascript_app_modal_dialog.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "components/app_modal/javascript_dialog_manager.h" | 10 #include "components/app_modal/javascript_dialog_manager.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 void EnforceMaxPromptSize(const base::string16& in_string, | 45 void EnforceMaxPromptSize(const base::string16& in_string, |
| 46 base::string16* out_string) { | 46 base::string16* out_string) { |
| 47 gfx::ElideString(in_string, kDefaultPromptMaxSize, out_string); | 47 gfx::ElideString(in_string, kDefaultPromptMaxSize, out_string); |
| 48 } | 48 } |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 ChromeJavaScriptDialogExtraData::ChromeJavaScriptDialogExtraData() | 53 ChromeJavaScriptDialogExtraData::ChromeJavaScriptDialogExtraData() |
| 54 : has_already_shown_a_dialog_(false), | 54 : has_already_shown_a_dialog_(false), |
| 55 suppress_javascript_messages_(false) {} | 55 suppress_javascript_messages_(false), |
| 56 suppressed_dialog_count_(0) {} |
| 56 | 57 |
| 57 JavaScriptAppModalDialog::JavaScriptAppModalDialog( | 58 JavaScriptAppModalDialog::JavaScriptAppModalDialog( |
| 58 content::WebContents* web_contents, | 59 content::WebContents* web_contents, |
| 59 ExtraDataMap* extra_data_map, | 60 ExtraDataMap* extra_data_map, |
| 60 const base::string16& title, | 61 const base::string16& title, |
| 61 content::JavaScriptMessageType javascript_message_type, | 62 content::JavaScriptMessageType javascript_message_type, |
| 62 const base::string16& message_text, | 63 const base::string16& message_text, |
| 63 const base::string16& default_prompt_text, | 64 const base::string16& default_prompt_text, |
| 64 bool display_suppress_checkbox, | 65 bool display_suppress_checkbox, |
| 65 bool is_before_unload_dialog, | 66 bool is_before_unload_dialog, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 UMA_HISTOGRAM_MEDIUM_TIMES( | 165 UMA_HISTOGRAM_MEDIUM_TIMES( |
| 165 "JSDialogs.FineTiming.TimeBetweenDialogCreatedAndSameDialogClosed", | 166 "JSDialogs.FineTiming.TimeBetweenDialogCreatedAndSameDialogClosed", |
| 166 base::TimeTicks::Now() - creation_time_); | 167 base::TimeTicks::Now() - creation_time_); |
| 167 if (!callback_.is_null()) { | 168 if (!callback_.is_null()) { |
| 168 callback_.Run(success, user_input); | 169 callback_.Run(success, user_input); |
| 169 callback_.Reset(); | 170 callback_.Reset(); |
| 170 } | 171 } |
| 171 } | 172 } |
| 172 | 173 |
| 173 } // namespace app_modal | 174 } // namespace app_modal |
| OLD | NEW |