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

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

Issue 10898002: Refactor BrowsingDataRemover creation for clarity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mac Created 8 years, 3 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/automation_provider.h" 5 #include "chrome/browser/automation/automation_provider.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 DCHECK(tab->GetWebContents()->GetBrowserContext() != NULL); 667 DCHECK(tab->GetWebContents()->GetBrowserContext() != NULL);
668 Profile* profile = Profile::FromBrowserContext( 668 Profile* profile = Profile::FromBrowserContext(
669 tab->GetWebContents()->GetBrowserContext()); 669 tab->GetWebContents()->GetBrowserContext());
670 profile->GetPrefs()->SetInteger(prefs::kWebKitDefaultFontSize, font_size); 670 profile->GetPrefs()->SetInteger(prefs::kWebKitDefaultFontSize, font_size);
671 } 671 }
672 } 672 }
673 } 673 }
674 674
675 void AutomationProvider::RemoveBrowsingData(int remove_mask) { 675 void AutomationProvider::RemoveBrowsingData(int remove_mask) {
676 BrowsingDataRemover* remover; 676 BrowsingDataRemover* remover;
677 remover = new BrowsingDataRemover(profile(), 677 remover = BrowsingDataRemover::CreateForUnboundedRange(profile());
678 BrowsingDataRemover::EVERYTHING, // All time periods.
679 base::Time());
680 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); 678 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB);
681 // BrowsingDataRemover deletes itself. 679 // BrowsingDataRemover deletes itself.
682 } 680 }
683 681
684 void AutomationProvider::JavaScriptStressTestControl(int tab_handle, 682 void AutomationProvider::JavaScriptStressTestControl(int tab_handle,
685 int cmd, 683 int cmd,
686 int param) { 684 int param) {
687 RenderViewHost* view = GetViewForTab(tab_handle); 685 RenderViewHost* view = GetViewForTab(tab_handle);
688 if (!view) { 686 if (!view) {
689 NOTREACHED(); 687 NOTREACHED();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 747
750 return NULL; 748 return NULL;
751 } 749 }
752 750
753 void AutomationProvider::SaveAsAsync(int tab_handle) { 751 void AutomationProvider::SaveAsAsync(int tab_handle) {
754 NavigationController* tab = NULL; 752 NavigationController* tab = NULL;
755 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); 753 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab);
756 if (web_contents) 754 if (web_contents)
757 web_contents->OnSavePage(); 755 web_contents->OnSavePage();
758 } 756 }
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