| 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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 new prerender::PrerenderMessageFilter(id, profile)); | 612 new prerender::PrerenderMessageFilter(id, profile)); |
| 613 | 613 |
| 614 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 614 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
| 615 profile->IsOffTheRecord())); | 615 profile->IsOffTheRecord())); |
| 616 | 616 |
| 617 SendExtensionWebRequestStatusToHost(host); | 617 SendExtensionWebRequestStatusToHost(host); |
| 618 | 618 |
| 619 RendererContentSettingRules rules; | 619 RendererContentSettingRules rules; |
| 620 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); | 620 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); |
| 621 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); | 621 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); |
| 622 | |
| 623 #if defined(OS_ANDROID) && defined(USE_LINUX_BREAKPAD) | |
| 624 InitCrashDumpManager(); | |
| 625 #endif | |
| 626 } | 622 } |
| 627 | 623 |
| 628 content::WebUIControllerFactory* | 624 content::WebUIControllerFactory* |
| 629 ChromeContentBrowserClient::GetWebUIControllerFactory() { | 625 ChromeContentBrowserClient::GetWebUIControllerFactory() { |
| 630 return ChromeWebUIControllerFactory::GetInstance(); | 626 return ChromeWebUIControllerFactory::GetInstance(); |
| 631 } | 627 } |
| 632 | 628 |
| 633 GURL ChromeContentBrowserClient::GetEffectiveURL( | 629 GURL ChromeContentBrowserClient::GetEffectiveURL( |
| 634 content::BrowserContext* browser_context, const GURL& url) { | 630 content::BrowserContext* browser_context, const GURL& url) { |
| 635 Profile* profile = Profile::FromBrowserContext(browser_context); | 631 Profile* profile = Profile::FromBrowserContext(browser_context); |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1839 | 1835 |
| 1840 const std::string locale = GetApplicationLocale(); | 1836 const std::string locale = GetApplicationLocale(); |
| 1841 FilePath locale_pak = ResourceBundle::GetSharedInstance(). | 1837 FilePath locale_pak = ResourceBundle::GetSharedInstance(). |
| 1842 GetLocaleFilePath(locale, false); | 1838 GetLocaleFilePath(locale, false); |
| 1843 f = base::CreatePlatformFile(locale_pak, flags, NULL, NULL); | 1839 f = base::CreatePlatformFile(locale_pak, flags, NULL, NULL); |
| 1844 DCHECK(f != base::kInvalidPlatformFileValue); | 1840 DCHECK(f != base::kInvalidPlatformFileValue); |
| 1845 mappings->push_back(FileDescriptorInfo(kAndroidLocalePakDescriptor, | 1841 mappings->push_back(FileDescriptorInfo(kAndroidLocalePakDescriptor, |
| 1846 FileDescriptor(f, true))); | 1842 FileDescriptor(f, true))); |
| 1847 | 1843 |
| 1848 #if defined(USE_LINUX_BREAKPAD) | 1844 #if defined(USE_LINUX_BREAKPAD) |
| 1849 f = crash_dump_manager_->CreateMinidumpFile(child_process_id); | 1845 f = CrashDumpManager::GetInstance()->CreateMinidumpFile(child_process_id); |
| 1850 if (f == base::kInvalidPlatformFileValue) { | 1846 if (f == base::kInvalidPlatformFileValue) { |
| 1851 LOG(ERROR) << "Failed to create file for minidump, crash reporting will be " | 1847 LOG(ERROR) << "Failed to create file for minidump, crash reporting will be " |
| 1852 "disabled for this process."; | 1848 "disabled for this process."; |
| 1853 } else { | 1849 } else { |
| 1854 mappings->push_back(FileDescriptorInfo(kAndroidMinidumpDescriptor, | 1850 mappings->push_back(FileDescriptorInfo(kAndroidMinidumpDescriptor, |
| 1855 FileDescriptor(f, true))); | 1851 FileDescriptor(f, true))); |
| 1856 } | 1852 } |
| 1857 #endif // defined(USE_LINUX_BREAKPAD) | 1853 #endif // defined(USE_LINUX_BREAKPAD) |
| 1858 | 1854 |
| 1859 #else | 1855 #else |
| 1860 int crash_signal_fd = GetCrashSignalFD(command_line); | 1856 int crash_signal_fd = GetCrashSignalFD(command_line); |
| 1861 if (crash_signal_fd >= 0) { | 1857 if (crash_signal_fd >= 0) { |
| 1862 mappings->push_back(FileDescriptorInfo(kCrashDumpSignal, | 1858 mappings->push_back(FileDescriptorInfo(kCrashDumpSignal, |
| 1863 FileDescriptor(crash_signal_fd, | 1859 FileDescriptor(crash_signal_fd, |
| 1864 false))); | 1860 false))); |
| 1865 } | 1861 } |
| 1866 #endif // defined(OS_ANDROID) | 1862 #endif // defined(OS_ANDROID) |
| 1867 } | 1863 } |
| 1868 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 1864 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| 1869 | 1865 |
| 1870 #if defined(OS_WIN) | 1866 #if defined(OS_WIN) |
| 1871 const wchar_t* ChromeContentBrowserClient::GetResourceDllName() { | 1867 const wchar_t* ChromeContentBrowserClient::GetResourceDllName() { |
| 1872 return chrome::kBrowserResourcesDll; | 1868 return chrome::kBrowserResourcesDll; |
| 1873 } | 1869 } |
| 1874 #endif | 1870 #endif |
| 1875 | 1871 |
| 1876 #if defined(OS_ANDROID) | |
| 1877 void ChromeContentBrowserClient::InitCrashDumpManager() { | |
| 1878 if (!crash_dump_manager_.get()) | |
| 1879 crash_dump_manager_.reset(new CrashDumpManager()); | |
| 1880 } | |
| 1881 #endif | |
| 1882 | |
| 1883 #if defined(USE_NSS) | 1872 #if defined(USE_NSS) |
| 1884 crypto::CryptoModuleBlockingPasswordDelegate* | 1873 crypto::CryptoModuleBlockingPasswordDelegate* |
| 1885 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1874 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 1886 const GURL& url) { | 1875 const GURL& url) { |
| 1887 return chrome::NewCryptoModuleBlockingDialogDelegate( | 1876 return chrome::NewCryptoModuleBlockingDialogDelegate( |
| 1888 chrome::kCryptoModulePasswordKeygen, url.host()); | 1877 chrome::kCryptoModulePasswordKeygen, url.host()); |
| 1889 } | 1878 } |
| 1890 #endif | 1879 #endif |
| 1891 | 1880 |
| 1892 void ChromeContentBrowserClient::SetApplicationLocale( | 1881 void ChromeContentBrowserClient::SetApplicationLocale( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1908 io_thread_application_locale_ = locale; | 1897 io_thread_application_locale_ = locale; |
| 1909 } | 1898 } |
| 1910 | 1899 |
| 1911 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1900 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
| 1912 const std::string& locale) { | 1901 const std::string& locale) { |
| 1913 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1902 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 1914 io_thread_application_locale_ = locale; | 1903 io_thread_application_locale_ = locale; |
| 1915 } | 1904 } |
| 1916 | 1905 |
| 1917 } // namespace chrome | 1906 } // namespace chrome |
| OLD | NEW |