Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/web_contents.h" | 5 #include "chrome/browser/web_contents.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1070 const std::wstring& message, | 1070 const std::wstring& message, |
| 1071 const std::wstring& default_prompt, | 1071 const std::wstring& default_prompt, |
| 1072 const int flags, | 1072 const int flags, |
| 1073 IPC::Message* reply_msg, | 1073 IPC::Message* reply_msg, |
| 1074 bool* did_suppress_message) { | 1074 bool* did_suppress_message) { |
| 1075 // Suppress javascript messages when requested and when inside a constrained | 1075 // Suppress javascript messages when requested and when inside a constrained |
| 1076 // popup window (because that activates them and breaks them out of the | 1076 // popup window (because that activates them and breaks them out of the |
| 1077 // constrained window jail). | 1077 // constrained window jail). |
| 1078 bool suppress_this_message = suppress_javascript_messages_; | 1078 bool suppress_this_message = suppress_javascript_messages_; |
| 1079 if (delegate()) | 1079 if (delegate()) |
| 1080 suppress_this_message |= delegate()->IsPopup(this); | 1080 suppress_this_message |= (delegate()->GetConstrainingContents(this) != NULL) ; |
|
Finnur
2008/11/11 07:30:03
Exceeds 80 chars.
| |
| 1081 | 1081 |
| 1082 *did_suppress_message = suppress_this_message; | 1082 *did_suppress_message = suppress_this_message; |
| 1083 | 1083 |
| 1084 if (!suppress_this_message) { | 1084 if (!suppress_this_message) { |
| 1085 TimeDelta time_since_last_message( | 1085 TimeDelta time_since_last_message( |
| 1086 TimeTicks::Now() - last_javascript_message_dismissal_); | 1086 TimeTicks::Now() - last_javascript_message_dismissal_); |
| 1087 bool show_suppress_checkbox = false; | 1087 bool show_suppress_checkbox = false; |
| 1088 // Show a checkbox offering to suppress further messages if this message is | 1088 // Show a checkbox offering to suppress further messages if this message is |
| 1089 // being displayed within kJavascriptMessageExpectedDelay of the last one. | 1089 // being displayed within kJavascriptMessageExpectedDelay of the last one. |
| 1090 if (time_since_last_message < | 1090 if (time_since_last_message < |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1821 // The favicon url isn't valid. This means there really isn't a favicon, | 1821 // The favicon url isn't valid. This means there really isn't a favicon, |
| 1822 // or the favicon url wasn't obtained before the load started. This assumes | 1822 // or the favicon url wasn't obtained before the load started. This assumes |
| 1823 // the later. | 1823 // the later. |
| 1824 // TODO(sky): Need a way to set the favicon that doesn't involve generating | 1824 // TODO(sky): Need a way to set the favicon that doesn't involve generating |
| 1825 // its url. | 1825 // its url. |
| 1826 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); | 1826 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); |
| 1827 } | 1827 } |
| 1828 new_url->set_safe_for_autoreplace(true); | 1828 new_url->set_safe_for_autoreplace(true); |
| 1829 url_model->Add(new_url); | 1829 url_model->Add(new_url); |
| 1830 } | 1830 } |
| OLD | NEW |