| 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 <set> |
| 8 #include <vector> |
| 9 |
| 7 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 8 #include "chrome/app/breakpad_mac.h" | 11 #include "chrome/app/breakpad_mac.h" |
| 9 #include "chrome/browser/browser_about_handler.h" | 12 #include "chrome/browser/browser_about_handler.h" |
| 10 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/browsing_data_remover.h" | 14 #include "chrome/browser/browsing_data_remover.h" |
| 12 #include "chrome/browser/character_encoding.h" | 15 #include "chrome/browser/character_encoding.h" |
| 13 #include "chrome/browser/chrome_benchmarking_message_filter.h" | 16 #include "chrome/browser/chrome_benchmarking_message_filter.h" |
| 14 #include "chrome/browser/chrome_plugin_message_filter.h" | 17 #include "chrome/browser/chrome_plugin_message_filter.h" |
| 15 #include "chrome/browser/chrome_quota_permission_context.h" | 18 #include "chrome/browser/chrome_quota_permission_context.h" |
| 16 #include "chrome/browser/chrome_worker_message_filter.h" | 19 #include "chrome/browser/chrome_worker_message_filter.h" |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 std::string ChromeContentBrowserClient::GetApplicationLocale() { | 564 std::string ChromeContentBrowserClient::GetApplicationLocale() { |
| 562 return g_browser_process->GetApplicationLocale(); | 565 return g_browser_process->GetApplicationLocale(); |
| 563 } | 566 } |
| 564 | 567 |
| 565 std::string ChromeContentBrowserClient::GetAcceptLangs(const TabContents* tab) { | 568 std::string ChromeContentBrowserClient::GetAcceptLangs(const TabContents* tab) { |
| 566 Profile* profile = Profile::FromBrowserContext(tab->browser_context()); | 569 Profile* profile = Profile::FromBrowserContext(tab->browser_context()); |
| 567 return profile->GetPrefs()->GetString(prefs::kAcceptLanguages); | 570 return profile->GetPrefs()->GetString(prefs::kAcceptLanguages); |
| 568 } | 571 } |
| 569 | 572 |
| 570 SkBitmap* ChromeContentBrowserClient::GetDefaultFavicon() { | 573 SkBitmap* ChromeContentBrowserClient::GetDefaultFavicon() { |
| 571 ResourceBundle &rb = ResourceBundle::GetSharedInstance(); | 574 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 572 #if defined(TOUCH_UI) | 575 #if defined(TOUCH_UI) |
| 573 // In touch builds, we want large default favicons for the tabstrip, but in | 576 // In touch builds, we want large default favicons for the tabstrip, but in |
| 574 // other places (such as bookmark, manage search engines, homepage) we assume | 577 // other places (such as bookmark, manage search engines, homepage) we assume |
| 575 // default favicons are 16x16. | 578 // default favicons are 16x16. |
| 576 return rb.GetBitmapNamed(IDR_DEFAULT_LARGE_FAVICON); | 579 return rb.GetBitmapNamed(IDR_DEFAULT_LARGE_FAVICON); |
| 577 #else | 580 #else |
| 578 return rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); | 581 return rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); |
| 579 #endif | 582 #endif |
| 580 } | 583 } |
| 581 | 584 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 | 661 |
| 659 return NULL; | 662 return NULL; |
| 660 } | 663 } |
| 661 | 664 |
| 662 QuotaPermissionContext* | 665 QuotaPermissionContext* |
| 663 ChromeContentBrowserClient::CreateQuotaPermissionContext() { | 666 ChromeContentBrowserClient::CreateQuotaPermissionContext() { |
| 664 return new ChromeQuotaPermissionContext(); | 667 return new ChromeQuotaPermissionContext(); |
| 665 } | 668 } |
| 666 | 669 |
| 667 void ChromeContentBrowserClient::OpenItem(const FilePath& path) { | 670 void ChromeContentBrowserClient::OpenItem(const FilePath& path) { |
| 668 // On Mac, this call needs to be done on the UI thread. On other platforms, | |
| 669 // do it on the FILE thread so we don't slow down UI. | |
| 670 #if defined(OS_MACOSX) | |
| 671 platform_util::OpenItem(path); | 671 platform_util::OpenItem(path); |
| 672 #else | |
| 673 BrowserThread::PostTask( | |
| 674 BrowserThread::FILE, FROM_HERE, | |
| 675 NewRunnableFunction(&platform_util::OpenItem, path)); | |
| 676 #endif | |
| 677 } | 672 } |
| 678 | 673 |
| 679 void ChromeContentBrowserClient::ShowItemInFolder(const FilePath& path) { | 674 void ChromeContentBrowserClient::ShowItemInFolder(const FilePath& path) { |
| 680 #if defined(OS_MACOSX) | 675 #if defined(OS_MACOSX) |
| 681 // Mac needs to run this operation on the UI thread. | 676 // Mac needs to run this operation on the UI thread. |
| 682 platform_util::ShowItemInFolder(path); | 677 platform_util::ShowItemInFolder(path); |
| 683 #else | 678 #else |
| 684 BrowserThread::PostTask( | 679 BrowserThread::PostTask( |
| 685 BrowserThread::FILE, FROM_HERE, | 680 BrowserThread::FILE, FROM_HERE, |
| 686 NewRunnableFunction(&platform_util::ShowItemInFolder, path)); | 681 NewRunnableFunction(&platform_util::ShowItemInFolder, path)); |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 #if defined(USE_NSS) | 985 #if defined(USE_NSS) |
| 991 crypto::CryptoModuleBlockingPasswordDelegate* | 986 crypto::CryptoModuleBlockingPasswordDelegate* |
| 992 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 987 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 993 const GURL& url) { | 988 const GURL& url) { |
| 994 return browser::NewCryptoModuleBlockingDialogDelegate( | 989 return browser::NewCryptoModuleBlockingDialogDelegate( |
| 995 browser::kCryptoModulePasswordKeygen, url.host()); | 990 browser::kCryptoModulePasswordKeygen, url.host()); |
| 996 } | 991 } |
| 997 #endif | 992 #endif |
| 998 | 993 |
| 999 } // namespace chrome | 994 } // namespace chrome |
| OLD | NEW |