| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/app/breakpad_mac.h" | 8 #include "chrome/app/breakpad_mac.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/character_encoding.h" | 10 #include "chrome/browser/character_encoding.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // extension URL. | 170 // extension URL. |
| 171 return extension->GetResourceURL(url.path()); | 171 return extension->GetResourceURL(url.path()); |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool ChromeContentBrowserClient::IsURLSameAsAnySiteInstance(const GURL& url) { | 174 bool ChromeContentBrowserClient::IsURLSameAsAnySiteInstance(const GURL& url) { |
| 175 return url.spec() == chrome::kAboutKillURL || | 175 return url.spec() == chrome::kAboutKillURL || |
| 176 url.spec() == chrome::kAboutHangURL || | 176 url.spec() == chrome::kAboutHangURL || |
| 177 url.spec() == chrome::kAboutShorthangURL; | 177 url.spec() == chrome::kAboutShorthangURL; |
| 178 } | 178 } |
| 179 | 179 |
| 180 GURL ChromeContentBrowserClient::GetAlternateErrorPageURL( | |
| 181 const TabContents* tab) { | |
| 182 GURL url; | |
| 183 // Disable alternate error pages when in OffTheRecord/Incognito mode. | |
| 184 if (tab->profile()->IsOffTheRecord()) | |
| 185 return url; | |
| 186 | |
| 187 PrefService* prefs = tab->profile()->GetPrefs(); | |
| 188 DCHECK(prefs); | |
| 189 if (prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled)) { | |
| 190 url = google_util::AppendGoogleLocaleParam( | |
| 191 GURL(google_util::kLinkDoctorBaseURL)); | |
| 192 url = google_util::AppendGoogleTLDParam(url); | |
| 193 } | |
| 194 return url; | |
| 195 } | |
| 196 | |
| 197 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( | 180 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
| 198 const std::string& alias_name) { | 181 const std::string& alias_name) { |
| 199 return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); | 182 return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); |
| 200 } | 183 } |
| 201 | 184 |
| 202 void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( | 185 void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( |
| 203 CommandLine* command_line, int child_process_id) { | 186 CommandLine* command_line, int child_process_id) { |
| 204 #if defined(USE_LINUX_BREAKPAD) | 187 #if defined(USE_LINUX_BREAKPAD) |
| 205 if (IsCrashReporterEnabled()) { | 188 if (IsCrashReporterEnabled()) { |
| 206 command_line->AppendSwitchASCII(switches::kEnableCrashReporter, | 189 command_line->AppendSwitchASCII(switches::kEnableCrashReporter, |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 338 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 356 | 339 |
| 357 if (process_type == switches::kGpuProcess) | 340 if (process_type == switches::kGpuProcess) |
| 358 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 341 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 359 | 342 |
| 360 return -1; | 343 return -1; |
| 361 } | 344 } |
| 362 #endif | 345 #endif |
| 363 | 346 |
| 364 } // namespace chrome | 347 } // namespace chrome |
| OLD | NEW |