| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" | 48 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
| 49 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 49 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
| 50 #include "chrome/browser/ui/browser_finder.h" | 50 #include "chrome/browser/ui/browser_finder.h" |
| 51 #include "chrome/browser/ui/browser_window.h" | 51 #include "chrome/browser/ui/browser_window.h" |
| 52 #include "chrome/browser/ui/find_bar/find_bar.h" | 52 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 53 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 53 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 54 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 54 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
| 55 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 55 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 56 #include "chrome/browser/ui/login/login_prompt.h" | 56 #include "chrome/browser/ui/login/login_prompt.h" |
| 57 #include "chrome/browser/ui/omnibox/location_bar.h" | 57 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 58 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 58 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 59 #include "chrome/common/automation_constants.h" | 59 #include "chrome/common/automation_constants.h" |
| 60 #include "chrome/common/automation_messages.h" | 60 #include "chrome/common/automation_messages.h" |
| 61 #include "chrome/common/chrome_constants.h" | 61 #include "chrome/common/chrome_constants.h" |
| 62 #include "chrome/common/chrome_paths.h" | 62 #include "chrome/common/chrome_paths.h" |
| 63 #include "chrome/common/chrome_switches.h" | 63 #include "chrome/common/chrome_switches.h" |
| 64 #include "chrome/common/chrome_version_info.h" | 64 #include "chrome/common/chrome_version_info.h" |
| 65 #include "chrome/common/pref_names.h" | 65 #include "chrome/common/pref_names.h" |
| 66 #include "chrome/common/render_messages.h" | 66 #include "chrome/common/render_messages.h" |
| 67 #include "chrome/common/url_constants.h" | 67 #include "chrome/common/url_constants.h" |
| 68 #include "content/public/browser/browser_thread.h" | 68 #include "content/public/browser/browser_thread.h" |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 IPC::Message* reply_message) { | 512 IPC::Message* reply_message) { |
| 513 int request_id = FindInPageNotificationObserver::kFindInPageRequestId; | 513 int request_id = FindInPageNotificationObserver::kFindInPageRequestId; |
| 514 FindInPageNotificationObserver* observer = | 514 FindInPageNotificationObserver* observer = |
| 515 new FindInPageNotificationObserver(this, | 515 new FindInPageNotificationObserver(this, |
| 516 web_contents, | 516 web_contents, |
| 517 with_json, | 517 with_json, |
| 518 reply_message); | 518 reply_message); |
| 519 if (!with_json) { | 519 if (!with_json) { |
| 520 find_in_page_observer_.reset(observer); | 520 find_in_page_observer_.reset(observer); |
| 521 } | 521 } |
| 522 TabContentsWrapper* wrapper = | 522 TabContents* tab_contents = |
| 523 TabContentsWrapper::GetCurrentWrapperForContents(web_contents); | 523 TabContents::GetOwningTabContentsForWebContents(web_contents); |
| 524 if (wrapper) | 524 if (tab_contents) |
| 525 wrapper->find_tab_helper()->set_current_find_request_id(request_id); | 525 tab_contents->find_tab_helper()->set_current_find_request_id(request_id); |
| 526 | 526 |
| 527 WebFindOptions options; | 527 WebFindOptions options; |
| 528 options.forward = forward; | 528 options.forward = forward; |
| 529 options.matchCase = match_case; | 529 options.matchCase = match_case; |
| 530 options.findNext = find_next; | 530 options.findNext = find_next; |
| 531 web_contents->GetRenderViewHost()->Find( | 531 web_contents->GetRenderViewHost()->Find( |
| 532 FindInPageNotificationObserver::kFindInPageRequestId, search_string, | 532 FindInPageNotificationObserver::kFindInPageRequestId, search_string, |
| 533 options); | 533 options); |
| 534 } | 534 } |
| 535 | 535 |
| (...skipping 221 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 |