| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/message_box_flags.h" | 10 #include "app/message_box_flags.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/browser/automation/automation_extension_function.h" | 26 #include "chrome/browser/automation/automation_extension_function.h" |
| 27 #include "chrome/browser/automation/automation_provider_list.h" | 27 #include "chrome/browser/automation/automation_provider_list.h" |
| 28 #include "chrome/browser/automation/automation_provider_observers.h" | 28 #include "chrome/browser/automation/automation_provider_observers.h" |
| 29 #include "chrome/browser/automation/extension_automation_constants.h" | 29 #include "chrome/browser/automation/extension_automation_constants.h" |
| 30 #include "chrome/browser/automation/extension_port_container.h" | 30 #include "chrome/browser/automation/extension_port_container.h" |
| 31 #include "chrome/browser/blocked_popup_container.h" | 31 #include "chrome/browser/blocked_popup_container.h" |
| 32 #include "chrome/browser/bookmarks/bookmark_model.h" | 32 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 33 #include "chrome/browser/bookmarks/bookmark_storage.h" | 33 #include "chrome/browser/bookmarks/bookmark_storage.h" |
| 34 #include "chrome/browser/browser_process.h" | 34 #include "chrome/browser/browser_process.h" |
| 35 #include "chrome/browser/browser_window.h" | 35 #include "chrome/browser/browser_window.h" |
| 36 #include "chrome/browser/browsing_data_remover.h" | |
| 37 #include "chrome/browser/chrome_thread.h" | 36 #include "chrome/browser/chrome_thread.h" |
| 38 #include "chrome/browser/dom_operation_notification_details.h" | 37 #include "chrome/browser/dom_operation_notification_details.h" |
| 39 #include "chrome/browser/debugger/devtools_manager.h" | 38 #include "chrome/browser/debugger/devtools_manager.h" |
| 40 #include "chrome/browser/download/download_manager.h" | 39 #include "chrome/browser/download/download_manager.h" |
| 41 #include "chrome/browser/download/download_shelf.h" | 40 #include "chrome/browser/download/download_shelf.h" |
| 42 #include "chrome/browser/extensions/crx_installer.h" | 41 #include "chrome/browser/extensions/crx_installer.h" |
| 43 #include "chrome/browser/extensions/extension_install_ui.h" | 42 #include "chrome/browser/extensions/extension_install_ui.h" |
| 44 #include "chrome/browser/extensions/extension_message_service.h" | 43 #include "chrome/browser/extensions/extension_message_service.h" |
| 45 #include "chrome/browser/extensions/user_script_master.h" | 44 #include "chrome/browser/extensions/user_script_master.h" |
| 46 #include "chrome/browser/find_bar.h" | 45 #include "chrome/browser/find_bar.h" |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 LoginWithUserAndPass) | 499 LoginWithUserAndPass) |
| 501 #endif | 500 #endif |
| 502 #if defined(TOOLKIT_VIEWS) | 501 #if defined(TOOLKIT_VIEWS) |
| 503 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WaitForFocusedViewIDToChange, | 502 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WaitForFocusedViewIDToChange, |
| 504 WaitForFocusedViewIDToChange) | 503 WaitForFocusedViewIDToChange) |
| 505 IPC_MESSAGE_HANDLER(AutomationMsg_StartTrackingPopupMenus, | 504 IPC_MESSAGE_HANDLER(AutomationMsg_StartTrackingPopupMenus, |
| 506 StartTrackingPopupMenus) | 505 StartTrackingPopupMenus) |
| 507 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WaitForPopupMenuToOpen, | 506 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WaitForPopupMenuToOpen, |
| 508 WaitForPopupMenuToOpen) | 507 WaitForPopupMenuToOpen) |
| 509 #endif | 508 #endif |
| 510 IPC_MESSAGE_HANDLER(AutomationMsg_RemoveBrowsingData, RemoveBrowsingData) | |
| 511 IPC_END_MESSAGE_MAP() | 509 IPC_END_MESSAGE_MAP() |
| 512 } | 510 } |
| 513 | 511 |
| 514 void AutomationProvider::ActivateTab(int handle, int at_index, int* status) { | 512 void AutomationProvider::ActivateTab(int handle, int at_index, int* status) { |
| 515 *status = -1; | 513 *status = -1; |
| 516 if (browser_tracker_->ContainsHandle(handle) && at_index > -1) { | 514 if (browser_tracker_->ContainsHandle(handle) && at_index > -1) { |
| 517 Browser* browser = browser_tracker_->GetResource(handle); | 515 Browser* browser = browser_tracker_->GetResource(handle); |
| 518 if (at_index >= 0 && at_index < browser->tab_count()) { | 516 if (at_index >= 0 && at_index < browser->tab_count()) { |
| 519 browser->SelectTabContentsAt(at_index, true); | 517 browser->SelectTabContentsAt(at_index, true); |
| 520 *status = 0; | 518 *status = 0; |
| (...skipping 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2344 NavigationController* tab = tab_tracker_->GetResource(tab_handle); | 2342 NavigationController* tab = tab_tracker_->GetResource(tab_handle); |
| 2345 DCHECK(tab != NULL); | 2343 DCHECK(tab != NULL); |
| 2346 if (tab && tab->tab_contents()) { | 2344 if (tab && tab->tab_contents()) { |
| 2347 DCHECK(tab->tab_contents()->profile() != NULL); | 2345 DCHECK(tab->tab_contents()->profile() != NULL); |
| 2348 tab->tab_contents()->profile()->GetPrefs()->SetInteger( | 2346 tab->tab_contents()->profile()->GetPrefs()->SetInteger( |
| 2349 prefs::kWebKitDefaultFontSize, font_size); | 2347 prefs::kWebKitDefaultFontSize, font_size); |
| 2350 } | 2348 } |
| 2351 } | 2349 } |
| 2352 } | 2350 } |
| 2353 | 2351 |
| 2354 void AutomationProvider::RemoveBrowsingData(int remove_mask) { | |
| 2355 BrowsingDataRemover* remover; | |
| 2356 remover = new BrowsingDataRemover(profile(), | |
| 2357 BrowsingDataRemover::EVERYTHING, // All time periods. | |
| 2358 base::Time()); | |
| 2359 remover->Remove(remove_mask); | |
| 2360 // BrowsingDataRemover deletes itself. | |
| 2361 } | |
| 2362 | 2352 |
| 2363 void AutomationProvider::WaitForBrowserWindowCountToBecome( | 2353 void AutomationProvider::WaitForBrowserWindowCountToBecome( |
| 2364 int target_count, IPC::Message* reply_message) { | 2354 int target_count, IPC::Message* reply_message) { |
| 2365 if (static_cast<int>(BrowserList::size()) == target_count) { | 2355 if (static_cast<int>(BrowserList::size()) == target_count) { |
| 2366 AutomationMsg_WaitForBrowserWindowCountToBecome::WriteReplyParams( | 2356 AutomationMsg_WaitForBrowserWindowCountToBecome::WriteReplyParams( |
| 2367 reply_message, true); | 2357 reply_message, true); |
| 2368 Send(reply_message); | 2358 Send(reply_message); |
| 2369 return; | 2359 return; |
| 2370 } | 2360 } |
| 2371 | 2361 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2561 | 2551 |
| 2562 void AutomationProvider::StartTrackingPopupMenus( | 2552 void AutomationProvider::StartTrackingPopupMenus( |
| 2563 int browser_handle, bool* success) { | 2553 int browser_handle, bool* success) { |
| 2564 NOTIMPLEMENTED(); | 2554 NOTIMPLEMENTED(); |
| 2565 } | 2555 } |
| 2566 | 2556 |
| 2567 void AutomationProvider::WaitForPopupMenuToOpen(IPC::Message* reply_message) { | 2557 void AutomationProvider::WaitForPopupMenuToOpen(IPC::Message* reply_message) { |
| 2568 NOTIMPLEMENTED(); | 2558 NOTIMPLEMENTED(); |
| 2569 } | 2559 } |
| 2570 #endif // !defined(TOOLKIT_VIEWS) | 2560 #endif // !defined(TOOLKIT_VIEWS) |
| OLD | NEW |