| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 bool BrowserProxy::WaitForBookmarkModelToLoad() { | 300 bool BrowserProxy::WaitForBookmarkModelToLoad() { |
| 301 if (!is_valid()) | 301 if (!is_valid()) |
| 302 return false; | 302 return false; |
| 303 | 303 |
| 304 bool result = false; | 304 bool result = false; |
| 305 sender_->Send(new AutomationMsg_WaitForBookmarkModelToLoad(handle_, &result)); | 305 sender_->Send(new AutomationMsg_WaitForBookmarkModelToLoad(handle_, &result)); |
| 306 return result; | 306 return result; |
| 307 } | 307 } |
| 308 | 308 |
| 309 bool BrowserProxy::AddBookmarkGroup(int64 parent_id, int index, | 309 bool BrowserProxy::AddBookmarkGroup(int64 parent_id, int index, |
| 310 std::wstring& title) { | 310 const string16& title) { |
| 311 if (!is_valid()) | 311 if (!is_valid()) |
| 312 return false; | 312 return false; |
| 313 bool result = false; | 313 bool result = false; |
| 314 sender_->Send(new AutomationMsg_AddBookmarkGroup(handle_, | 314 sender_->Send(new AutomationMsg_AddBookmarkGroup(handle_, |
| 315 parent_id, index, | 315 parent_id, index, |
| 316 title, | 316 title, |
| 317 &result)); | 317 &result)); |
| 318 return result; | 318 return result; |
| 319 } | 319 } |
| 320 | 320 |
| 321 bool BrowserProxy::AddBookmarkURL(int64 parent_id, int index, | 321 bool BrowserProxy::AddBookmarkURL(int64 parent_id, int index, |
| 322 std::wstring& title, const GURL& url) { | 322 const string16& title, const GURL& url) { |
| 323 if (!is_valid()) | 323 if (!is_valid()) |
| 324 return false; | 324 return false; |
| 325 bool result = false; | 325 bool result = false; |
| 326 sender_->Send(new AutomationMsg_AddBookmarkURL(handle_, | 326 sender_->Send(new AutomationMsg_AddBookmarkURL(handle_, |
| 327 parent_id, index, | 327 parent_id, index, |
| 328 title, url, | 328 title, url, |
| 329 &result)); | 329 &result)); |
| 330 return result; | 330 return result; |
| 331 } | 331 } |
| 332 | 332 |
| 333 bool BrowserProxy::ReparentBookmark(int64 id, int64 new_parent_id, int index) { | 333 bool BrowserProxy::ReparentBookmark(int64 id, int64 new_parent_id, int index) { |
| 334 if (!is_valid()) | 334 if (!is_valid()) |
| 335 return false; | 335 return false; |
| 336 bool result = false; | 336 bool result = false; |
| 337 sender_->Send(new AutomationMsg_ReparentBookmark(handle_, | 337 sender_->Send(new AutomationMsg_ReparentBookmark(handle_, |
| 338 id, new_parent_id, | 338 id, new_parent_id, |
| 339 index, | 339 index, |
| 340 &result)); | 340 &result)); |
| 341 return result; | 341 return result; |
| 342 } | 342 } |
| 343 | 343 |
| 344 bool BrowserProxy::SetBookmarkTitle(int64 id, const std::wstring& title) { | 344 bool BrowserProxy::SetBookmarkTitle(int64 id, const string16& title) { |
| 345 if (!is_valid()) | 345 if (!is_valid()) |
| 346 return false; | 346 return false; |
| 347 bool result = false; | 347 bool result = false; |
| 348 sender_->Send(new AutomationMsg_SetBookmarkTitle(handle_, | 348 sender_->Send(new AutomationMsg_SetBookmarkTitle(handle_, |
| 349 id, title, | 349 id, title, |
| 350 &result)); | 350 &result)); |
| 351 return result; | 351 return result; |
| 352 } | 352 } |
| 353 | 353 |
| 354 bool BrowserProxy::SetBookmarkURL(int64 id, const GURL& url) { | 354 bool BrowserProxy::SetBookmarkURL(int64 id, const GURL& url) { |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 if (i == 0) | 639 if (i == 0) |
| 640 *min_start_time = start_ms; | 640 *min_start_time = start_ms; |
| 641 | 641 |
| 642 *min_start_time = std::min(start_ms, *min_start_time); | 642 *min_start_time = std::min(start_ms, *min_start_time); |
| 643 *max_stop_time = std::max(stop_ms, *max_stop_time); | 643 *max_stop_time = std::max(stop_ms, *max_stop_time); |
| 644 stop_times->push_back(stop_ms); | 644 stop_times->push_back(stop_ms); |
| 645 } | 645 } |
| 646 std::sort(stop_times->begin(), stop_times->end()); | 646 std::sort(stop_times->begin(), stop_times->end()); |
| 647 return true; | 647 return true; |
| 648 } | 648 } |
| OLD | NEW |