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

Side by Side Diff: chrome/browser/automation/testing_automation_provider_views.cc

Issue 10828265: Replace views::LocatedEvent with ui::LocatedEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include "chrome/browser/automation/automation_window_tracker.h" 7 #include "chrome/browser/automation/automation_window_tracker.h"
8 #include "ui/views/view.h" 8 #include "ui/views/view.h"
9 #include "ui/views/widget/widget.h" 9 #include "ui/views/widget/widget.h"
10 10
11 void TestingAutomationProvider::WindowGetViewBounds(int handle, 11 void TestingAutomationProvider::WindowGetViewBounds(int handle,
12 int view_id, 12 int view_id,
13 bool screen_coordinates, 13 bool screen_coordinates,
14 bool* success, 14 bool* success,
15 gfx::Rect* bounds) { 15 gfx::Rect* bounds) {
16 *success = false; 16 *success = false;
17 17
18 if (window_tracker_->ContainsHandle(handle)) { 18 if (window_tracker_->ContainsHandle(handle)) {
19 gfx::NativeWindow window = window_tracker_->GetResource(handle); 19 gfx::NativeWindow window = window_tracker_->GetResource(handle);
20 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); 20 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window);
21 if (widget) { 21 if (widget) {
22 views::View* root_view = widget->GetRootView(); 22 views::View* root_view = widget->GetRootView();
23 views::View* view = root_view->GetViewByID(view_id); 23 views::View* view = root_view->GetViewByID(view_id);
24 if (view) { 24 if (view) {
25 *success = true; 25 *success = true;
26 gfx::Point point; 26 gfx::Point point;
27 if (screen_coordinates) 27 if (screen_coordinates)
28 views::View::ConvertPointToScreen(view, &point); 28 views::View::ConvertPointToScreen(view, &point);
29 else 29 else
30 views::View::ConvertPointToView(view, root_view, &point); 30 views::View::ConvertPointToTarget(view, root_view, &point);
31 *bounds = view->GetContentsBounds(); 31 *bounds = view->GetContentsBounds();
32 bounds->set_origin(point); 32 bounds->set_origin(point);
33 } 33 }
34 } 34 }
35 } 35 }
36 } 36 }
OLDNEW
« no previous file with comments | « ash/wm/workspace/frame_maximize_button.cc ('k') | chrome/browser/chromeos/input_method/candidate_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698