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 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 handler->AddHandlerPair(&WillHandleBrowserAboutURL, | 1587 handler->AddHandlerPair(&WillHandleBrowserAboutURL, |
1588 BrowserURLHandler::null_handler()); | 1588 BrowserURLHandler::null_handler()); |
1589 // chrome: & friends. | 1589 // chrome: & friends. |
1590 handler->AddHandlerPair(&HandleWebUI, | 1590 handler->AddHandlerPair(&HandleWebUI, |
1591 BrowserURLHandler::null_handler()); | 1591 BrowserURLHandler::null_handler()); |
1592 } | 1592 } |
1593 | 1593 |
1594 void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) { | 1594 void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) { |
1595 Profile* profile = Profile::FromBrowserContext( | 1595 Profile* profile = Profile::FromBrowserContext( |
1596 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); | 1596 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); |
1597 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, | 1597 BrowsingDataRemover* remover = |
1598 BrowsingDataRemover::EVERYTHING, | 1598 BrowsingDataRemover::CreateForUnboundedRange(profile); |
1599 base::Time::Now()); | |
1600 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, | 1599 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, |
1601 BrowsingDataHelper::UNPROTECTED_WEB); | 1600 BrowsingDataHelper::UNPROTECTED_WEB); |
1602 // BrowsingDataRemover takes care of deleting itself when done. | 1601 // BrowsingDataRemover takes care of deleting itself when done. |
1603 } | 1602 } |
1604 | 1603 |
1605 void ChromeContentBrowserClient::ClearCookies(RenderViewHost* rvh) { | 1604 void ChromeContentBrowserClient::ClearCookies(RenderViewHost* rvh) { |
1606 Profile* profile = Profile::FromBrowserContext( | 1605 Profile* profile = Profile::FromBrowserContext( |
1607 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); | 1606 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); |
1608 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, | 1607 BrowsingDataRemover* remover = |
1609 BrowsingDataRemover::EVERYTHING, | 1608 BrowsingDataRemover::CreateForUnboundedRange(profile); |
1610 base::Time::Now()); | |
1611 int remove_mask = BrowsingDataRemover::REMOVE_SITE_DATA; | 1609 int remove_mask = BrowsingDataRemover::REMOVE_SITE_DATA; |
1612 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); | 1610 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); |
1613 // BrowsingDataRemover takes care of deleting itself when done. | 1611 // BrowsingDataRemover takes care of deleting itself when done. |
1614 } | 1612 } |
1615 | 1613 |
1616 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { | 1614 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { |
1617 return download_util::GetDefaultDownloadDirectory(); | 1615 return download_util::GetDefaultDownloadDirectory(); |
1618 } | 1616 } |
1619 | 1617 |
1620 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { | 1618 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 partition_id = extension->id(); | 1732 partition_id = extension->id(); |
1735 } | 1733 } |
1736 | 1734 |
1737 // Enforce that IsValidStoragePartitionId() implementation stays in sync. | 1735 // Enforce that IsValidStoragePartitionId() implementation stays in sync. |
1738 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 1736 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
1739 return partition_id; | 1737 return partition_id; |
1740 } | 1738 } |
1741 | 1739 |
1742 | 1740 |
1743 } // namespace chrome | 1741 } // namespace chrome |
OLD | NEW |