Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3222)

Unified Diff: chrome/browser/automation/automation_provider_views.cc

Issue 338067: Gets AutomationProxyVisibleTest.WindowGetViewBounds to pass on... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/automation_provider_views.cc
===================================================================
--- chrome/browser/automation/automation_provider_views.cc (revision 0)
+++ chrome/browser/automation/automation_provider_views.cc (revision 0)
@@ -0,0 +1,36 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/automation/automation_provider.h"
+
+#include "base/gfx/point.h"
+#include "views/view.h"
+#include "views/widget/root_view.h"
+#include "views/widget/widget.h"
+
+void AutomationProvider::WindowGetViewBounds(int handle, int view_id,
+ bool screen_coordinates,
+ bool* success,
+ gfx::Rect* bounds) {
+ *success = false;
+
+ if (window_tracker_->ContainsHandle(handle)) {
+ gfx::NativeWindow window = window_tracker_->GetResource(handle);
+ views::RootView* root_view = views::Widget::FindRootView(window);
+ if (root_view) {
+ views::View* view = root_view->GetViewByID(view_id);
+ if (view) {
+ *success = true;
+ gfx::Point point;
+ if (screen_coordinates)
+ views::View::ConvertPointToScreen(view, &point);
+ else
+ views::View::ConvertPointToView(view, root_view, &point);
+ *bounds = view->GetLocalBounds(false);
+ bounds->set_origin(point);
+ }
+ }
+ }
+}
+
Property changes on: chrome/browser/automation/automation_provider_views.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/automation/automation_provider_gtk.cc ('k') | chrome/browser/automation/automation_provider_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698