OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test/automation/browser_proxy.h" | 5 #include "chrome/test/automation/browser_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 base::PlatformThread::Sleep( | 198 base::PlatformThread::Sleep( |
199 base::TimeDelta::FromMilliseconds(automation::kSleepTime)); | 199 base::TimeDelta::FromMilliseconds(automation::kSleepTime)); |
200 int active_tab; | 200 int active_tab; |
201 if (GetActiveTabIndex(&active_tab) && active_tab == tab) | 201 if (GetActiveTabIndex(&active_tab) && active_tab == tab) |
202 return true; | 202 return true; |
203 } | 203 } |
204 // If we get here, the active tab hasn't changed. | 204 // If we get here, the active tab hasn't changed. |
205 return false; | 205 return false; |
206 } | 206 } |
207 | 207 |
208 bool BrowserProxy::OpenFindInPage() { | |
209 if (!is_valid()) | |
210 return false; | |
211 | |
212 return sender_->Send(new AutomationMsg_OpenFindInPage(handle_)); | |
213 // This message expects no response. | |
214 } | |
215 | |
216 bool BrowserProxy::IsFindWindowFullyVisible(bool* is_visible) { | 208 bool BrowserProxy::IsFindWindowFullyVisible(bool* is_visible) { |
217 if (!is_valid()) | 209 if (!is_valid()) |
218 return false; | 210 return false; |
219 | 211 |
220 if (!is_visible) { | 212 if (!is_visible) { |
221 NOTREACHED(); | 213 NOTREACHED(); |
222 return false; | 214 return false; |
223 } | 215 } |
224 | 216 |
225 return sender_->Send( | 217 return sender_->Send( |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 if (i == 0) | 453 if (i == 0) |
462 *min_start_time = start_ms; | 454 *min_start_time = start_ms; |
463 | 455 |
464 *min_start_time = std::min(start_ms, *min_start_time); | 456 *min_start_time = std::min(start_ms, *min_start_time); |
465 *max_stop_time = std::max(stop_ms, *max_stop_time); | 457 *max_stop_time = std::max(stop_ms, *max_stop_time); |
466 stop_times->push_back(stop_ms); | 458 stop_times->push_back(stop_ms); |
467 } | 459 } |
468 std::sort(stop_times->begin(), stop_times->end()); | 460 std::sort(stop_times->begin(), stop_times->end()); |
469 return true; | 461 return true; |
470 } | 462 } |
OLD | NEW |