Chromium Code Reviews| 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 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1504 handler->AddHandlerPair(&HandleWebUI, | 1505 handler->AddHandlerPair(&HandleWebUI, |
| 1505 BrowserURLHandler::null_handler()); | 1506 BrowserURLHandler::null_handler()); |
| 1506 } | 1507 } |
| 1507 | 1508 |
| 1508 void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) { | 1509 void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) { |
| 1509 Profile* profile = Profile::FromBrowserContext( | 1510 Profile* profile = Profile::FromBrowserContext( |
| 1510 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); | 1511 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); |
| 1511 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, | 1512 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, |
| 1512 BrowsingDataRemover::EVERYTHING, | 1513 BrowsingDataRemover::EVERYTHING, |
| 1513 base::Time()); | 1514 base::Time()); |
| 1514 remover->Remove(BrowsingDataRemover::REMOVE_CACHE); | 1515 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, |
| 1516 BrowsingDataHelper::UNPROTECTED_WEB); | |
| 1515 // BrowsingDataRemover takes care of deleting itself when done. | 1517 // BrowsingDataRemover takes care of deleting itself when done. |
| 1516 } | 1518 } |
| 1517 | 1519 |
| 1518 void ChromeContentBrowserClient::ClearCookies(RenderViewHost* rvh) { | 1520 void ChromeContentBrowserClient::ClearCookies(RenderViewHost* rvh) { |
| 1519 Profile* profile = Profile::FromBrowserContext( | 1521 Profile* profile = Profile::FromBrowserContext( |
| 1520 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); | 1522 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); |
| 1521 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, | 1523 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, |
| 1522 BrowsingDataRemover::EVERYTHING, | 1524 BrowsingDataRemover::EVERYTHING, |
| 1523 base::Time()); | 1525 base::Time()); |
| 1524 int remove_mask = BrowsingDataRemover::REMOVE_SITE_DATA; | 1526 int remove_mask = BrowsingDataRemover::REMOVE_SITE_DATA; |
| 1525 remover->Remove(remove_mask); | 1527 bool include_protected_origins = false; |
|
Bernhard Bauer
2012/05/31 15:57:31
Is this implicitly casted to an int? I hate C++.
Mike West
2012/06/01 13:35:17
So ugly. Thanks for catching this.
| |
| 1528 remover->Remove(remove_mask, include_protected_origins); | |
| 1526 // BrowsingDataRemover takes care of deleting itself when done. | 1529 // BrowsingDataRemover takes care of deleting itself when done. |
| 1527 } | 1530 } |
| 1528 | 1531 |
| 1529 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { | 1532 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { |
| 1530 return download_util::GetDefaultDownloadDirectory(); | 1533 return download_util::GetDefaultDownloadDirectory(); |
| 1531 } | 1534 } |
| 1532 | 1535 |
| 1533 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { | 1536 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { |
| 1534 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); | 1537 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); |
| 1535 } | 1538 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1614 #if defined(USE_NSS) | 1617 #if defined(USE_NSS) |
| 1615 crypto::CryptoModuleBlockingPasswordDelegate* | 1618 crypto::CryptoModuleBlockingPasswordDelegate* |
| 1616 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1619 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 1617 const GURL& url) { | 1620 const GURL& url) { |
| 1618 return browser::NewCryptoModuleBlockingDialogDelegate( | 1621 return browser::NewCryptoModuleBlockingDialogDelegate( |
| 1619 browser::kCryptoModulePasswordKeygen, url.host()); | 1622 browser::kCryptoModulePasswordKeygen, url.host()); |
| 1620 } | 1623 } |
| 1621 #endif | 1624 #endif |
| 1622 | 1625 |
| 1623 } // namespace chrome | 1626 } // namespace chrome |
| OLD | NEW |