| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/string_tokenizer.h" | 13 #include "base/string_tokenizer.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/app/breakpad_mac.h" | 15 #include "chrome/app/breakpad_mac.h" |
| 16 #include "chrome/browser/browser_about_handler.h" | 16 #include "chrome/browser/browser_about_handler.h" |
| 17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/browsing_data_helper.h" |
| 18 #include "chrome/browser/browsing_data_remover.h" | 19 #include "chrome/browser/browsing_data_remover.h" |
| 19 #include "chrome/browser/character_encoding.h" | 20 #include "chrome/browser/character_encoding.h" |
| 20 #include "chrome/browser/chrome_benchmarking_message_filter.h" | 21 #include "chrome/browser/chrome_benchmarking_message_filter.h" |
| 21 #include "chrome/browser/chrome_quota_permission_context.h" | 22 #include "chrome/browser/chrome_quota_permission_context.h" |
| 22 #include "chrome/browser/content_settings/content_settings_utils.h" | 23 #include "chrome/browser/content_settings/content_settings_utils.h" |
| 23 #include "chrome/browser/content_settings/cookie_settings.h" | 24 #include "chrome/browser/content_settings/cookie_settings.h" |
| 24 #include "chrome/browser/content_settings/host_content_settings_map.h" | 25 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 25 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 26 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 26 #include "chrome/browser/defaults.h" | 27 #include "chrome/browser/defaults.h" |
| 27 #include "chrome/browser/download/download_util.h" | 28 #include "chrome/browser/download/download_util.h" |
| (...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1520 handler->AddHandlerPair(&HandleWebUI, | 1521 handler->AddHandlerPair(&HandleWebUI, |
| 1521 BrowserURLHandler::null_handler()); | 1522 BrowserURLHandler::null_handler()); |
| 1522 } | 1523 } |
| 1523 | 1524 |
| 1524 void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) { | 1525 void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) { |
| 1525 Profile* profile = Profile::FromBrowserContext( | 1526 Profile* profile = Profile::FromBrowserContext( |
| 1526 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); | 1527 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); |
| 1527 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, | 1528 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, |
| 1528 BrowsingDataRemover::EVERYTHING, | 1529 BrowsingDataRemover::EVERYTHING, |
| 1529 base::Time()); | 1530 base::Time()); |
| 1530 remover->Remove(BrowsingDataRemover::REMOVE_CACHE); | 1531 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, |
| 1532 BrowsingDataHelper::UNPROTECTED_WEB); |
| 1531 // BrowsingDataRemover takes care of deleting itself when done. | 1533 // BrowsingDataRemover takes care of deleting itself when done. |
| 1532 } | 1534 } |
| 1533 | 1535 |
| 1534 void ChromeContentBrowserClient::ClearCookies(RenderViewHost* rvh) { | 1536 void ChromeContentBrowserClient::ClearCookies(RenderViewHost* rvh) { |
| 1535 Profile* profile = Profile::FromBrowserContext( | 1537 Profile* profile = Profile::FromBrowserContext( |
| 1536 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); | 1538 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); |
| 1537 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, | 1539 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, |
| 1538 BrowsingDataRemover::EVERYTHING, | 1540 BrowsingDataRemover::EVERYTHING, |
| 1539 base::Time()); | 1541 base::Time()); |
| 1540 int remove_mask = BrowsingDataRemover::REMOVE_SITE_DATA; | 1542 int remove_mask = BrowsingDataRemover::REMOVE_SITE_DATA; |
| 1541 remover->Remove(remove_mask); | 1543 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); |
| 1542 // BrowsingDataRemover takes care of deleting itself when done. | 1544 // BrowsingDataRemover takes care of deleting itself when done. |
| 1543 } | 1545 } |
| 1544 | 1546 |
| 1545 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { | 1547 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { |
| 1546 return download_util::GetDefaultDownloadDirectory(); | 1548 return download_util::GetDefaultDownloadDirectory(); |
| 1547 } | 1549 } |
| 1548 | 1550 |
| 1549 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { | 1551 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { |
| 1550 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); | 1552 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); |
| 1551 } | 1553 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1630 #if defined(USE_NSS) | 1632 #if defined(USE_NSS) |
| 1631 crypto::CryptoModuleBlockingPasswordDelegate* | 1633 crypto::CryptoModuleBlockingPasswordDelegate* |
| 1632 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1634 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 1633 const GURL& url) { | 1635 const GURL& url) { |
| 1634 return browser::NewCryptoModuleBlockingDialogDelegate( | 1636 return browser::NewCryptoModuleBlockingDialogDelegate( |
| 1635 browser::kCryptoModulePasswordKeygen, url.host()); | 1637 browser::kCryptoModulePasswordKeygen, url.host()); |
| 1636 } | 1638 } |
| 1637 #endif | 1639 #endif |
| 1638 | 1640 |
| 1639 } // namespace chrome | 1641 } // namespace chrome |
| OLD | NEW |