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/tab_proxy.h" | 5 #include "chrome/test/automation/tab_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 if (idx != std::string::npos) { | 268 if (idx != std::string::npos) { |
269 cookies.erase(0, idx + namestr.length()); | 269 cookies.erase(0, idx + namestr.length()); |
270 *cookie = cookies.substr(0, cookies.find(";")); | 270 *cookie = cookies.substr(0, cookies.find(";")); |
271 } else { | 271 } else { |
272 cookie->clear(); | 272 cookie->clear(); |
273 } | 273 } |
274 | 274 |
275 return true; | 275 return true; |
276 } | 276 } |
277 | 277 |
278 bool TabProxy::SetCookie(const GURL& url, const std::string& value) { | |
279 int response_value = 0; | |
280 return sender_->Send(new AutomationMsg_SetCookie(url, value, handle_, | |
281 &response_value)); | |
282 } | |
283 | |
284 bool TabProxy::GetDownloadDirectory(FilePath* directory) { | |
285 DCHECK(directory); | |
286 if (!is_valid()) | |
287 return false; | |
288 | |
289 return sender_->Send(new AutomationMsg_DownloadDirectory(handle_, | |
290 directory)); | |
291 } | |
292 | |
293 bool TabProxy::Close() { | 278 bool TabProxy::Close() { |
294 return Close(false); | 279 return Close(false); |
295 } | 280 } |
296 | 281 |
297 bool TabProxy::Close(bool wait_until_closed) { | 282 bool TabProxy::Close(bool wait_until_closed) { |
298 if (!is_valid()) | 283 if (!is_valid()) |
299 return false; | 284 return false; |
300 | 285 |
301 bool succeeded = false; | 286 bool succeeded = false; |
302 sender_->Send(new AutomationMsg_CloseTab(handle_, wait_until_closed, | 287 sender_->Send(new AutomationMsg_CloseTab(handle_, wait_until_closed, |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 | 522 |
538 TabProxy::~TabProxy() {} | 523 TabProxy::~TabProxy() {} |
539 | 524 |
540 void TabProxy::FirstObjectAdded() { | 525 void TabProxy::FirstObjectAdded() { |
541 AddRef(); | 526 AddRef(); |
542 } | 527 } |
543 | 528 |
544 void TabProxy::LastObjectRemoved() { | 529 void TabProxy::LastObjectRemoved() { |
545 Release(); | 530 Release(); |
546 } | 531 } |
OLD | NEW |