Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 10830210: Fix crbug.com/140910 (BrowsingDataRemover not working). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More places fixed, added DCHECK and conversion to BrowsingDataRemover. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/automation/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 3745 matching lines...) Expand 10 before | Expand all | Expand 10 after
3756 remove_mask |= string_to_mask_value[removal]; 3756 remove_mask |= string_to_mask_value[removal];
3757 } 3757 }
3758 3758
3759 if (!ContainsKey(string_to_time_period, time_period)) { 3759 if (!ContainsKey(string_to_time_period, time_period)) {
3760 AutomationJSONReply(this, reply_message) 3760 AutomationJSONReply(this, reply_message)
3761 .SendError("Invalid string for time_period."); 3761 .SendError("Invalid string for time_period.");
3762 return; 3762 return;
3763 } 3763 }
3764 3764
3765 BrowsingDataRemover* remover = new BrowsingDataRemover( 3765 BrowsingDataRemover* remover = new BrowsingDataRemover(
3766 profile(), string_to_time_period[time_period], base::Time()); 3766 profile(), string_to_time_period[time_period], base::Time::Now());
3767 3767
3768 remover->AddObserver( 3768 remover->AddObserver(
3769 new AutomationProviderBrowsingDataObserver(this, reply_message)); 3769 new AutomationProviderBrowsingDataObserver(this, reply_message));
3770 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); 3770 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB);
3771 // BrowsingDataRemover deletes itself using DeleteHelper. 3771 // BrowsingDataRemover deletes itself using DeleteHelper.
3772 // The observer also deletes itself after sending the reply. 3772 // The observer also deletes itself after sending the reply.
3773 } 3773 }
3774 3774
3775 namespace { 3775 namespace {
3776 3776
(...skipping 3400 matching lines...) Expand 10 before | Expand all | Expand 10 after
7177 void TestingAutomationProvider::OnRemoveProvider() { 7177 void TestingAutomationProvider::OnRemoveProvider() {
7178 if (g_browser_process) 7178 if (g_browser_process)
7179 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 7179 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
7180 } 7180 }
7181 7181
7182 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 7182 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
7183 WebContents* tab) { 7183 WebContents* tab) {
7184 if (chrome::GetActiveWebContents(browser) != tab) 7184 if (chrome::GetActiveWebContents(browser) != tab)
7185 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); 7185 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true);
7186 } 7186 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698