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 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1588 handler->AddHandlerPair(&WillHandleBrowserAboutURL, | 1588 handler->AddHandlerPair(&WillHandleBrowserAboutURL, |
1589 BrowserURLHandler::null_handler()); | 1589 BrowserURLHandler::null_handler()); |
1590 // chrome: & friends. | 1590 // chrome: & friends. |
1591 handler->AddHandlerPair(&HandleWebUI, | 1591 handler->AddHandlerPair(&HandleWebUI, |
1592 BrowserURLHandler::null_handler()); | 1592 BrowserURLHandler::null_handler()); |
1593 } | 1593 } |
1594 | 1594 |
1595 void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) { | 1595 void ChromeContentBrowserClient::ClearCache(RenderViewHost* rvh) { |
1596 Profile* profile = Profile::FromBrowserContext( | 1596 Profile* profile = Profile::FromBrowserContext( |
1597 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); | 1597 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); |
1598 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, | 1598 BrowsingDataRemover* remover = |
1599 BrowsingDataRemover::EVERYTHING, | 1599 BrowsingDataRemover::CreateForUnboundedRange(profile); |
1600 base::Time::Now()); | |
1601 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, | 1600 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, |
1602 BrowsingDataHelper::UNPROTECTED_WEB); | 1601 BrowsingDataHelper::UNPROTECTED_WEB); |
1603 // BrowsingDataRemover takes care of deleting itself when done. | 1602 // BrowsingDataRemover takes care of deleting itself when done. |
1604 } | 1603 } |
1605 | 1604 |
1606 void ChromeContentBrowserClient::ClearCookies(RenderViewHost* rvh) { | 1605 void ChromeContentBrowserClient::ClearCookies(RenderViewHost* rvh) { |
1607 Profile* profile = Profile::FromBrowserContext( | 1606 Profile* profile = Profile::FromBrowserContext( |
1608 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); | 1607 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext()); |
1609 BrowsingDataRemover* remover = new BrowsingDataRemover(profile, | 1608 BrowsingDataRemover* remover = BrowsingDataRemover::CreateForPeriod(profile, |
jam
2012/08/28 16:13:04
I'm confused about this change, the previous two c
Mike West
2012/09/03 08:02:57
No, you're right: this should also be calling Crea
| |
1610 BrowsingDataRemover::EVERYTHING, | 1609 BrowsingDataRemover::EVERYTHING); |
1611 base::Time::Now()); | |
1612 int remove_mask = BrowsingDataRemover::REMOVE_SITE_DATA; | 1610 int remove_mask = BrowsingDataRemover::REMOVE_SITE_DATA; |
1613 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); | 1611 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); |
1614 // BrowsingDataRemover takes care of deleting itself when done. | 1612 // BrowsingDataRemover takes care of deleting itself when done. |
1615 } | 1613 } |
1616 | 1614 |
1617 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { | 1615 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { |
1618 return download_util::GetDefaultDownloadDirectory(); | 1616 return download_util::GetDefaultDownloadDirectory(); |
1619 } | 1617 } |
1620 | 1618 |
1621 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { | 1619 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1735 partition_id = extension->id(); | 1733 partition_id = extension->id(); |
1736 } | 1734 } |
1737 | 1735 |
1738 // Enforce that IsValidStoragePartitionId() implementation stays in sync. | 1736 // Enforce that IsValidStoragePartitionId() implementation stays in sync. |
1739 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 1737 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
1740 return partition_id; | 1738 return partition_id; |
1741 } | 1739 } |
1742 | 1740 |
1743 | 1741 |
1744 } // namespace chrome | 1742 } // namespace chrome |
OLD | NEW |