| 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 "chrome/app/locales/locale_settings.h" | 10 #include "chrome/app/locales/locale_settings.h" |
| (...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 void WebContents::DidGetPrintedPagesCount(int cookie, int number_pages) { | 1150 void WebContents::DidGetPrintedPagesCount(int cookie, int number_pages) { |
| 1151 printing_.DidGetPrintedPagesCount(cookie, number_pages); | 1151 printing_.DidGetPrintedPagesCount(cookie, number_pages); |
| 1152 } | 1152 } |
| 1153 | 1153 |
| 1154 void WebContents::DidPrintPage(const ViewHostMsg_DidPrintPage_Params& params) { | 1154 void WebContents::DidPrintPage(const ViewHostMsg_DidPrintPage_Params& params) { |
| 1155 printing_.DidPrintPage(params); | 1155 printing_.DidPrintPage(params); |
| 1156 } | 1156 } |
| 1157 | 1157 |
| 1158 GURL WebContents::GetAlternateErrorPageURL() const { | 1158 GURL WebContents::GetAlternateErrorPageURL() const { |
| 1159 GURL url; | 1159 GURL url; |
| 1160 // Disable alternate error pages when in OffTheRecord/Incognito mode. |
| 1161 if (profile()->IsOffTheRecord()) |
| 1162 return url; |
| 1163 |
| 1160 PrefService* prefs = profile()->GetPrefs(); | 1164 PrefService* prefs = profile()->GetPrefs(); |
| 1161 DCHECK(prefs); | 1165 DCHECK(prefs); |
| 1162 if (prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled)) { | 1166 if (prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled)) { |
| 1163 url = google_util::AppendGoogleLocaleParam(GURL(kLinkDoctorBaseURL)); | 1167 url = google_util::AppendGoogleLocaleParam(GURL(kLinkDoctorBaseURL)); |
| 1164 url = google_util::AppendGoogleTLDParam(url); | 1168 url = google_util::AppendGoogleTLDParam(url); |
| 1165 } | 1169 } |
| 1166 return url; | 1170 return url; |
| 1167 } | 1171 } |
| 1168 | 1172 |
| 1169 WebPreferences WebContents::GetWebkitPrefs() { | 1173 WebPreferences WebContents::GetWebkitPrefs() { |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 // The favicon url isn't valid. This means there really isn't a favicon, | 1745 // The favicon url isn't valid. This means there really isn't a favicon, |
| 1742 // or the favicon url wasn't obtained before the load started. This assumes | 1746 // or the favicon url wasn't obtained before the load started. This assumes |
| 1743 // the later. | 1747 // the later. |
| 1744 // TODO(sky): Need a way to set the favicon that doesn't involve generating | 1748 // TODO(sky): Need a way to set the favicon that doesn't involve generating |
| 1745 // its url. | 1749 // its url. |
| 1746 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); | 1750 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); |
| 1747 } | 1751 } |
| 1748 new_url->set_safe_for_autoreplace(true); | 1752 new_url->set_safe_for_autoreplace(true); |
| 1749 url_model->Add(new_url); | 1753 url_model->Add(new_url); |
| 1750 } | 1754 } |
| OLD | NEW |