| OLD | NEW |
| 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_browser_tracker.h" | 7 #include "chrome/browser/automation/automation_browser_tracker.h" |
| 8 #include "chrome/browser/automation/automation_window_tracker.h" | 8 #include "chrome/browser/automation/automation_window_tracker.h" |
| 9 #include "chrome/browser/browser_window.h" | 9 #include "chrome/browser/browser_window.h" |
| 10 #include "chrome/browser/ui/views/frame/browser_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_view.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 views::RootView* root_view = views::Widget::FindRootView(window); | 124 views::RootView* root_view = views::Widget::FindRootView(window); |
| 125 if (root_view) { | 125 if (root_view) { |
| 126 views::View* view = root_view->GetViewByID(view_id); | 126 views::View* view = root_view->GetViewByID(view_id); |
| 127 if (view) { | 127 if (view) { |
| 128 *success = true; | 128 *success = true; |
| 129 gfx::Point point; | 129 gfx::Point point; |
| 130 if (screen_coordinates) | 130 if (screen_coordinates) |
| 131 views::View::ConvertPointToScreen(view, &point); | 131 views::View::ConvertPointToScreen(view, &point); |
| 132 else | 132 else |
| 133 views::View::ConvertPointToView(view, root_view, &point); | 133 views::View::ConvertPointToView(view, root_view, &point); |
| 134 *bounds = view->GetLocalBounds(); | 134 *bounds = view->GetContentsBounds(); |
| 135 bounds->set_origin(point); | 135 bounds->set_origin(point); |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 void TestingAutomationProvider::GetFocusedViewID(int handle, int* view_id) { | 141 void TestingAutomationProvider::GetFocusedViewID(int handle, int* view_id) { |
| 142 *view_id = -1; | 142 *view_id = -1; |
| 143 if (window_tracker_->ContainsHandle(handle)) { | 143 if (window_tracker_->ContainsHandle(handle)) { |
| 144 gfx::NativeWindow window = window_tracker_->GetResource(handle); | 144 gfx::NativeWindow window = window_tracker_->GetResource(handle); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 reply_message, true); | 187 reply_message, true); |
| 188 Send(reply_message); | 188 Send(reply_message); |
| 189 return; | 189 return; |
| 190 } | 190 } |
| 191 | 191 |
| 192 // Otherwise, register this reply message with the waiter, | 192 // Otherwise, register this reply message with the waiter, |
| 193 // which will handle responding to this IPC when the popup | 193 // which will handle responding to this IPC when the popup |
| 194 // menu opens. | 194 // menu opens. |
| 195 popup_menu_waiter_->set_reply_message(reply_message); | 195 popup_menu_waiter_->set_reply_message(reply_message); |
| 196 } | 196 } |
| OLD | NEW |