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/automation_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "chrome/browser/browsing_data_remover.h" | 39 #include "chrome/browser/browsing_data_remover.h" |
40 #include "chrome/browser/character_encoding.h" | 40 #include "chrome/browser/character_encoding.h" |
41 #include "chrome/browser/content_settings/host_content_settings_map.h" | 41 #include "chrome/browser/content_settings/host_content_settings_map.h" |
42 #include "chrome/browser/net/url_request_mock_util.h" | 42 #include "chrome/browser/net/url_request_mock_util.h" |
43 #include "chrome/browser/prefs/pref_service.h" | 43 #include "chrome/browser/prefs/pref_service.h" |
44 #include "chrome/browser/printing/print_job.h" | 44 #include "chrome/browser/printing/print_job.h" |
45 #include "chrome/browser/profiles/profile_manager.h" | 45 #include "chrome/browser/profiles/profile_manager.h" |
46 #include "chrome/browser/ssl/ssl_blocking_page.h" | 46 #include "chrome/browser/ssl/ssl_blocking_page.h" |
47 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" | 47 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
48 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 48 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
49 #include "chrome/browser/ui/browser_list.h" | 49 #include "chrome/browser/ui/browser_finder.h" |
50 #include "chrome/browser/ui/browser_window.h" | 50 #include "chrome/browser/ui/browser_window.h" |
51 #include "chrome/browser/ui/find_bar/find_bar.h" | 51 #include "chrome/browser/ui/find_bar/find_bar.h" |
52 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 52 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
53 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 53 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
54 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 54 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
55 #include "chrome/browser/ui/login/login_prompt.h" | 55 #include "chrome/browser/ui/login/login_prompt.h" |
56 #include "chrome/browser/ui/omnibox/location_bar.h" | 56 #include "chrome/browser/ui/omnibox/location_bar.h" |
57 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 57 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
58 #include "chrome/common/automation_constants.h" | 58 #include "chrome/common/automation_constants.h" |
59 #include "chrome/common/automation_messages.h" | 59 #include "chrome/common/automation_messages.h" |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 } | 465 } |
466 | 466 |
467 bool AutomationProvider::Send(IPC::Message* msg) { | 467 bool AutomationProvider::Send(IPC::Message* msg) { |
468 DCHECK(channel_.get()); | 468 DCHECK(channel_.get()); |
469 return channel_->Send(msg); | 469 return channel_->Send(msg); |
470 } | 470 } |
471 | 471 |
472 Browser* AutomationProvider::FindAndActivateTab( | 472 Browser* AutomationProvider::FindAndActivateTab( |
473 NavigationController* controller) { | 473 NavigationController* controller) { |
474 int tab_index; | 474 int tab_index; |
475 Browser* browser = Browser::GetBrowserForController(controller, &tab_index); | 475 Browser* browser = browser::FindBrowserForController(controller, &tab_index); |
476 if (browser) | 476 if (browser) |
477 browser->ActivateTabAt(tab_index, true); | 477 browser->ActivateTabAt(tab_index, true); |
478 | 478 |
479 return browser; | 479 return browser; |
480 } | 480 } |
481 | 481 |
482 void AutomationProvider::HandleFindRequest( | 482 void AutomationProvider::HandleFindRequest( |
483 int handle, | 483 int handle, |
484 const AutomationMsg_Find_Params& params, | 484 const AutomationMsg_Find_Params& params, |
485 IPC::Message* reply_message) { | 485 IPC::Message* reply_message) { |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 | 757 |
758 return NULL; | 758 return NULL; |
759 } | 759 } |
760 | 760 |
761 void AutomationProvider::SaveAsAsync(int tab_handle) { | 761 void AutomationProvider::SaveAsAsync(int tab_handle) { |
762 NavigationController* tab = NULL; | 762 NavigationController* tab = NULL; |
763 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); | 763 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); |
764 if (web_contents) | 764 if (web_contents) |
765 web_contents->OnSavePage(); | 765 web_contents->OnSavePage(); |
766 } | 766 } |
OLD | NEW |