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

Side by Side 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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/automation/automation_provider.h"
6
7 #include "base/gfx/point.h"
8 #include "views/view.h"
9 #include "views/widget/root_view.h"
10 #include "views/widget/widget.h"
11
12 void AutomationProvider::WindowGetViewBounds(int handle, int view_id,
13 bool screen_coordinates,
14 bool* success,
15 gfx::Rect* bounds) {
16 *success = false;
17
18 if (window_tracker_->ContainsHandle(handle)) {
19 gfx::NativeWindow window = window_tracker_->GetResource(handle);
20 views::RootView* root_view = views::Widget::FindRootView(window);
21 if (root_view) {
22 views::View* view = root_view->GetViewByID(view_id);
23 if (view) {
24 *success = true;
25 gfx::Point point;
26 if (screen_coordinates)
27 views::View::ConvertPointToScreen(view, &point);
28 else
29 views::View::ConvertPointToView(view, root_view, &point);
30 *bounds = view->GetLocalBounds(false);
31 bounds->set_origin(point);
32 }
33 }
34 }
35 }
36
OLDNEW
« 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