| 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 3574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3585 AutomationJSONReply(this, reply_message) | 3585 AutomationJSONReply(this, reply_message) |
| 3586 .SendError("Invalid string for time_period."); | 3586 .SendError("Invalid string for time_period."); |
| 3587 return; | 3587 return; |
| 3588 } | 3588 } |
| 3589 | 3589 |
| 3590 BrowsingDataRemover* remover = new BrowsingDataRemover( | 3590 BrowsingDataRemover* remover = new BrowsingDataRemover( |
| 3591 profile(), string_to_time_period[time_period], base::Time()); | 3591 profile(), string_to_time_period[time_period], base::Time()); |
| 3592 | 3592 |
| 3593 remover->AddObserver( | 3593 remover->AddObserver( |
| 3594 new AutomationProviderBrowsingDataObserver(this, reply_message)); | 3594 new AutomationProviderBrowsingDataObserver(this, reply_message)); |
| 3595 remover->Remove(remove_mask); | 3595 remover->Remove(remove_mask, BrowsingDataRemover::UNPROTECTED_WEB); |
| 3596 // BrowsingDataRemover deletes itself using DeleteTask. | 3596 // BrowsingDataRemover deletes itself using DeleteTask. |
| 3597 // The observer also deletes itself after sending the reply. | 3597 // The observer also deletes itself after sending the reply. |
| 3598 } | 3598 } |
| 3599 | 3599 |
| 3600 namespace { | 3600 namespace { |
| 3601 | 3601 |
| 3602 // Get the TabContentsWrapper from a dictionary of arguments. | 3602 // Get the TabContentsWrapper from a dictionary of arguments. |
| 3603 TabContentsWrapper* GetTabContentsWrapperFromDict(const Browser* browser, | 3603 TabContentsWrapper* GetTabContentsWrapperFromDict(const Browser* browser, |
| 3604 const DictionaryValue* args, | 3604 const DictionaryValue* args, |
| 3605 std::string* error_message) { | 3605 std::string* error_message) { |
| (...skipping 2967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6573 | 6573 |
| 6574 void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle( | 6574 void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle( |
| 6575 IPC::Message* reply_message) { | 6575 IPC::Message* reply_message) { |
| 6576 new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message); | 6576 new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message); |
| 6577 } | 6577 } |
| 6578 | 6578 |
| 6579 void TestingAutomationProvider::OnRemoveProvider() { | 6579 void TestingAutomationProvider::OnRemoveProvider() { |
| 6580 if (g_browser_process) | 6580 if (g_browser_process) |
| 6581 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6581 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 6582 } | 6582 } |
| OLD | NEW |