summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-21 15:03:01 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-21 15:03:01 +0000
commit9e0534be9784821a8507f20a873d6410b21680e5 (patch)
treec6dd8baa8bf9986df0168cf54c6a5c8b5c49e0e9 /chrome/browser/automation
parent1c023d6ec42e2dd30e8a31edbb2cdd49db86cfc4 (diff)
downloadchromium_src-9e0534be9784821a8507f20a873d6410b21680e5.zip
chromium_src-9e0534be9784821a8507f20a873d6410b21680e5.tar.gz
chromium_src-9e0534be9784821a8507f20a873d6410b21680e5.tar.bz2
Factor find in page out of WebContents and into the view, since it is almost
all view specific. Rename find in page controller to be "FindBarWin", and find in page view to be "findBarView" (since this is not Windows specific, but "Views" specific). I did lots of simplification and moving around of the find in page API. I coalesced several of the show functions into one master function on the view. I removed some other sizing and window updating code from WebContents and moved it to the view. Review URL: http://codereview.chromium.org/7667 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider.cc33
1 files changed, 19 insertions, 14 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 85443a9..56003de 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/automation/automation_provider.h"
#include "base/path_service.h"
-#include "chrome/app/chrome_dll_resource.h"
+#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/automation/automation_provider_list.h"
#include "chrome/browser/automation/ui_controls.h"
#include "chrome/browser/automation/url_request_failed_dns_job.h"
@@ -24,6 +24,7 @@
#include "chrome/browser/ssl_manager.h"
#include "chrome/browser/ssl_blocking_page.h"
#include "chrome/browser/web_contents.h"
+#include "chrome/browser/web_contents_view.h"
#include "chrome/browser/views/bookmark_bar_view.h"
#include "chrome/browser/views/location_bar_view.h"
#include "chrome/common/chrome_paths.h"
@@ -1715,17 +1716,18 @@ void AutomationProvider::HandleFindRequest(const IPC::Message& message,
FindInPageNotificationObserver(this, tab_contents, message.routing_id()));
// The find in page dialog must be up for us to get the notification that the
- // find was complete
- if (tab_contents->AsWebContents()) {
+ // find was complete.
+ WebContents* web_contents = tab_contents->AsWebContents();
+ if (web_contents) {
NavigationController* tab = tab_tracker_->GetResource(handle);
Browser* browser = Browser::GetBrowserForController(tab, NULL);
- tab_contents->AsWebContents()->OpenFindInPageWindow(*browser);
- }
+ web_contents->view()->FindInPage(*browser, true, request.forward);
- tab_contents->StartFinding(
- FindInPageNotificationObserver::kFindInPageRequestId,
- request.search_string, request.forward, request.match_case,
- request.find_next);
+ web_contents->render_view_host()->StartFinding(
+ FindInPageNotificationObserver::kFindInPageRequestId,
+ request.search_string, request.forward, request.match_case,
+ request.find_next);
+ }
}
void AutomationProvider::HandleOpenFindInPageRequest(
@@ -1734,16 +1736,17 @@ void AutomationProvider::HandleOpenFindInPageRequest(
WebContents* web_contents = GetWebContentsForHandle(handle, &tab);
if (web_contents) {
Browser* browser = Browser::GetBrowserForController(tab, NULL);
- web_contents->OpenFindInPageWindow(*browser);
+ web_contents->view()->FindInPage(*browser, false, false);
}
}
void AutomationProvider::GetFindWindowVisibility(const IPC::Message& message,
int handle) {
+ gfx::Point position;
bool visible = false;
WebContents* web_contents = GetWebContentsForHandle(handle, NULL);
if (web_contents)
- visible = web_contents->IsFindWindowFullyVisible();
+ visible = web_contents->view()->GetFindBarWindowInfo(&position, &visible);
Send(new AutomationMsg_FindWindowVisibilityResponse(message.routing_id(),
visible));
@@ -1751,13 +1754,15 @@ void AutomationProvider::GetFindWindowVisibility(const IPC::Message& message,
void AutomationProvider::HandleFindWindowLocationRequest(
const IPC::Message& message, int handle) {
- int x = -1, y = -1;
+ gfx::Point position(0, 0);
+ bool visible = false;
WebContents* web_contents = GetWebContentsForHandle(handle, NULL);
if (web_contents)
- web_contents->GetFindInPageWindowLocation(&x, &y);
+ visible = web_contents->view()->GetFindBarWindowInfo(&position, &visible);
Send(new AutomationMsg_FindWindowLocationResponse(message.routing_id(),
- x, y));
+ position.x(),
+ position.y()));
}
void AutomationProvider::GetBookmarkBarVisitility(const IPC::Message& message,