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 3641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3652 .SendError("Invalid string for time_period."); | 3652 .SendError("Invalid string for time_period."); |
3653 return; | 3653 return; |
3654 } | 3654 } |
3655 | 3655 |
3656 BrowsingDataRemover* remover = new BrowsingDataRemover( | 3656 BrowsingDataRemover* remover = new BrowsingDataRemover( |
3657 profile(), string_to_time_period[time_period], base::Time()); | 3657 profile(), string_to_time_period[time_period], base::Time()); |
3658 | 3658 |
3659 remover->AddObserver( | 3659 remover->AddObserver( |
3660 new AutomationProviderBrowsingDataObserver(this, reply_message)); | 3660 new AutomationProviderBrowsingDataObserver(this, reply_message)); |
3661 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); | 3661 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); |
3662 // BrowsingDataRemover deletes itself using DeleteTask. | 3662 // BrowsingDataRemover deletes itself using DeleteHelper. |
3663 // The observer also deletes itself after sending the reply. | 3663 // The observer also deletes itself after sending the reply. |
3664 } | 3664 } |
3665 | 3665 |
3666 namespace { | 3666 namespace { |
3667 | 3667 |
3668 // Get the TabContents from a dictionary of arguments. | 3668 // Get the TabContents from a dictionary of arguments. |
3669 TabContents* GetTabContentsFromDict(const Browser* browser, | 3669 TabContents* GetTabContentsFromDict(const Browser* browser, |
3670 const DictionaryValue* args, | 3670 const DictionaryValue* args, |
3671 std::string* error_message) { | 3671 std::string* error_message) { |
3672 int tab_index; | 3672 int tab_index; |
(...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6735 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6735 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6736 } | 6736 } |
6737 | 6737 |
6738 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6738 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
6739 WebContents* tab) { | 6739 WebContents* tab) { |
6740 if (browser->GetActiveWebContents() != tab) { | 6740 if (browser->GetActiveWebContents() != tab) { |
6741 browser->ActivateTabAt(browser->GetIndexOfController( | 6741 browser->ActivateTabAt(browser->GetIndexOfController( |
6742 &tab->GetController()), true); | 6742 &tab->GetController()), true); |
6743 } | 6743 } |
6744 } | 6744 } |
OLD | NEW |