| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 const float kMaxWidthFactor = 0.5; | 129 const float kMaxWidthFactor = 0.5; |
| 130 const float kMaxHeightFactor = 0.6; | 130 const float kMaxHeightFactor = 0.6; |
| 131 #endif | 131 #endif |
| 132 | 132 |
| 133 // If another javascript message box is displayed within | 133 // If another javascript message box is displayed within |
| 134 // kJavascriptMessageExpectedDelay of a previous javascript message box being | 134 // kJavascriptMessageExpectedDelay of a previous javascript message box being |
| 135 // dismissed, display an option to suppress future message boxes from this | 135 // dismissed, display an option to suppress future message boxes from this |
| 136 // contents. | 136 // contents. |
| 137 const int kJavascriptMessageExpectedDelay = 1000; | 137 const int kJavascriptMessageExpectedDelay = 1000; |
| 138 | 138 |
| 139 const char kLinkDoctorBaseURL[] = | |
| 140 "http://linkhelp.clients.google.com/tbproxy/lh/fixurl"; | |
| 141 | |
| 142 // The list of prefs we want to observe. | 139 // The list of prefs we want to observe. |
| 143 const wchar_t* kPrefsToObserve[] = { | 140 const wchar_t* kPrefsToObserve[] = { |
| 144 prefs::kAlternateErrorPagesEnabled, | 141 prefs::kAlternateErrorPagesEnabled, |
| 145 prefs::kWebKitJavaEnabled, | 142 prefs::kWebKitJavaEnabled, |
| 146 prefs::kWebKitJavascriptEnabled, | 143 prefs::kWebKitJavascriptEnabled, |
| 147 prefs::kWebKitLoadsImagesAutomatically, | 144 prefs::kWebKitLoadsImagesAutomatically, |
| 148 prefs::kWebKitPluginsEnabled, | 145 prefs::kWebKitPluginsEnabled, |
| 149 prefs::kWebKitUsesUniversalDetector, | 146 prefs::kWebKitUsesUniversalDetector, |
| 150 prefs::kWebKitSerifFontFamily, | 147 prefs::kWebKitSerifFontFamily, |
| 151 prefs::kWebKitSansSerifFontFamily, | 148 prefs::kWebKitSansSerifFontFamily, |
| (...skipping 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2316 | 2313 |
| 2317 GURL TabContents::GetAlternateErrorPageURL() const { | 2314 GURL TabContents::GetAlternateErrorPageURL() const { |
| 2318 GURL url; | 2315 GURL url; |
| 2319 // Disable alternate error pages when in OffTheRecord/Incognito mode. | 2316 // Disable alternate error pages when in OffTheRecord/Incognito mode. |
| 2320 if (profile()->IsOffTheRecord()) | 2317 if (profile()->IsOffTheRecord()) |
| 2321 return url; | 2318 return url; |
| 2322 | 2319 |
| 2323 PrefService* prefs = profile()->GetPrefs(); | 2320 PrefService* prefs = profile()->GetPrefs(); |
| 2324 DCHECK(prefs); | 2321 DCHECK(prefs); |
| 2325 if (prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled)) { | 2322 if (prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled)) { |
| 2326 url = google_util::AppendGoogleLocaleParam(GURL(kLinkDoctorBaseURL)); | 2323 url = google_util::AppendGoogleLocaleParam( |
| 2324 GURL(google_util::kLinkDoctorBaseURL)); |
| 2327 url = google_util::AppendGoogleTLDParam(url); | 2325 url = google_util::AppendGoogleTLDParam(url); |
| 2328 } | 2326 } |
| 2329 return url; | 2327 return url; |
| 2330 } | 2328 } |
| 2331 | 2329 |
| 2332 WebPreferences TabContents::GetWebkitPrefs() { | 2330 WebPreferences TabContents::GetWebkitPrefs() { |
| 2333 PrefService* prefs = render_view_host()->process()->profile()->GetPrefs(); | 2331 PrefService* prefs = render_view_host()->process()->profile()->GetPrefs(); |
| 2334 bool is_dom_ui = false; | 2332 bool is_dom_ui = false; |
| 2335 return RenderViewHostDelegateHelper::GetWebkitPrefs(prefs, is_dom_ui); | 2333 return RenderViewHostDelegateHelper::GetWebkitPrefs(prefs, is_dom_ui); |
| 2336 } | 2334 } |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2526 | 2524 |
| 2527 default: | 2525 default: |
| 2528 NOTREACHED(); | 2526 NOTREACHED(); |
| 2529 } | 2527 } |
| 2530 } | 2528 } |
| 2531 | 2529 |
| 2532 void TabContents::set_encoding(const std::string& encoding) { | 2530 void TabContents::set_encoding(const std::string& encoding) { |
| 2533 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); | 2531 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); |
| 2534 } | 2532 } |
| 2535 | 2533 |
| OLD | NEW |