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/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 Loading... |
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 Loading... |
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 } |
OLD | NEW |