| 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 24 matching lines...) Expand all Loading... |
| 35 #include "chrome/browser/automation/automation_provider_json.h" | 35 #include "chrome/browser/automation/automation_provider_json.h" |
| 36 #include "chrome/browser/automation/automation_provider_list.h" | 36 #include "chrome/browser/automation/automation_provider_list.h" |
| 37 #include "chrome/browser/automation/automation_provider_observers.h" | 37 #include "chrome/browser/automation/automation_provider_observers.h" |
| 38 #include "chrome/browser/automation/automation_tab_tracker.h" | 38 #include "chrome/browser/automation/automation_tab_tracker.h" |
| 39 #include "chrome/browser/automation/automation_util.h" | 39 #include "chrome/browser/automation/automation_util.h" |
| 40 #include "chrome/browser/automation/automation_window_tracker.h" | 40 #include "chrome/browser/automation/automation_window_tracker.h" |
| 41 #include "chrome/browser/bookmarks/bookmark_model.h" | 41 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 42 #include "chrome/browser/bookmarks/bookmark_storage.h" | 42 #include "chrome/browser/bookmarks/bookmark_storage.h" |
| 43 #include "chrome/browser/browser_process.h" | 43 #include "chrome/browser/browser_process.h" |
| 44 #include "chrome/browser/browser_shutdown.h" | 44 #include "chrome/browser/browser_shutdown.h" |
| 45 #include "chrome/browser/browsing_data_helper.h" |
| 46 #include "chrome/browser/browsing_data_remover.h" |
| 45 #include "chrome/browser/content_settings/host_content_settings_map.h" | 47 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 46 #include "chrome/browser/debugger/devtools_window.h" | 48 #include "chrome/browser/debugger/devtools_window.h" |
| 47 #include "chrome/browser/download/download_prefs.h" | 49 #include "chrome/browser/download/download_prefs.h" |
| 48 #include "chrome/browser/download/download_service.h" | 50 #include "chrome/browser/download/download_service.h" |
| 49 #include "chrome/browser/download/download_service_factory.h" | 51 #include "chrome/browser/download/download_service_factory.h" |
| 50 #include "chrome/browser/download/download_shelf.h" | 52 #include "chrome/browser/download/download_shelf.h" |
| 51 #include "chrome/browser/download/save_package_file_picker.h" | 53 #include "chrome/browser/download/save_package_file_picker.h" |
| 52 #include "chrome/browser/extensions/browser_action_test_util.h" | 54 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 53 #include "chrome/browser/extensions/crx_installer.h" | 55 #include "chrome/browser/extensions/crx_installer.h" |
| 54 #include "chrome/browser/extensions/extension_host.h" | 56 #include "chrome/browser/extensions/extension_host.h" |
| (...skipping 3532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3587 AutomationJSONReply(this, reply_message) | 3589 AutomationJSONReply(this, reply_message) |
| 3588 .SendError("Invalid string for time_period."); | 3590 .SendError("Invalid string for time_period."); |
| 3589 return; | 3591 return; |
| 3590 } | 3592 } |
| 3591 | 3593 |
| 3592 BrowsingDataRemover* remover = new BrowsingDataRemover( | 3594 BrowsingDataRemover* remover = new BrowsingDataRemover( |
| 3593 profile(), string_to_time_period[time_period], base::Time()); | 3595 profile(), string_to_time_period[time_period], base::Time()); |
| 3594 | 3596 |
| 3595 remover->AddObserver( | 3597 remover->AddObserver( |
| 3596 new AutomationProviderBrowsingDataObserver(this, reply_message)); | 3598 new AutomationProviderBrowsingDataObserver(this, reply_message)); |
| 3597 remover->Remove(remove_mask); | 3599 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); |
| 3598 // BrowsingDataRemover deletes itself using DeleteTask. | 3600 // BrowsingDataRemover deletes itself using DeleteTask. |
| 3599 // The observer also deletes itself after sending the reply. | 3601 // The observer also deletes itself after sending the reply. |
| 3600 } | 3602 } |
| 3601 | 3603 |
| 3602 namespace { | 3604 namespace { |
| 3603 | 3605 |
| 3604 // Get the TabContentsWrapper from a dictionary of arguments. | 3606 // Get the TabContentsWrapper from a dictionary of arguments. |
| 3605 TabContentsWrapper* GetTabContentsWrapperFromDict(const Browser* browser, | 3607 TabContentsWrapper* GetTabContentsWrapperFromDict(const Browser* browser, |
| 3606 const DictionaryValue* args, | 3608 const DictionaryValue* args, |
| 3607 std::string* error_message) { | 3609 std::string* error_message) { |
| (...skipping 3034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6642 } | 6644 } |
| 6643 | 6645 |
| 6644 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6646 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 6645 WebContents* tab) { | 6647 WebContents* tab) { |
| 6646 if (browser->GetSelectedWebContents() != tab || | 6648 if (browser->GetSelectedWebContents() != tab || |
| 6647 browser != BrowserList::GetLastActive()) { | 6649 browser != BrowserList::GetLastActive()) { |
| 6648 browser->ActivateTabAt(browser->GetIndexOfController(&tab->GetController()), | 6650 browser->ActivateTabAt(browser->GetIndexOfController(&tab->GetController()), |
| 6649 true /* user_gesture */); | 6651 true /* user_gesture */); |
| 6650 } | 6652 } |
| 6651 } | 6653 } |
| OLD | NEW |