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 <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 automation_util::DeleteCookie(url, cookie_name, contents, success); | 561 automation_util::DeleteCookie(url, cookie_name, contents, success); |
562 } | 562 } |
563 | 563 |
564 void TestingAutomationProvider::ShowCollectedCookiesDialog( | 564 void TestingAutomationProvider::ShowCollectedCookiesDialog( |
565 int handle, bool* success) { | 565 int handle, bool* success) { |
566 *success = false; | 566 *success = false; |
567 if (tab_tracker_->ContainsHandle(handle)) { | 567 if (tab_tracker_->ContainsHandle(handle)) { |
568 NavigationController* controller = tab_tracker_->GetResource(handle); | 568 NavigationController* controller = tab_tracker_->GetResource(handle); |
569 TabContents* tab_contents = controller->tab_contents(); | 569 TabContents* tab_contents = controller->tab_contents(); |
570 Browser* browser = Browser::GetBrowserForController(controller, NULL); | 570 Browser* browser = Browser::GetBrowserForController(controller, NULL); |
571 browser->ShowCollectedCookiesDialog(tab_contents); | 571 browser->ShowCollectedCookiesDialog( |
| 572 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents)); |
572 *success = true; | 573 *success = true; |
573 } | 574 } |
574 } | 575 } |
575 | 576 |
576 void TestingAutomationProvider::NavigateToURLBlockUntilNavigationsComplete( | 577 void TestingAutomationProvider::NavigateToURLBlockUntilNavigationsComplete( |
577 int handle, const GURL& url, int number_of_navigations, | 578 int handle, const GURL& url, int number_of_navigations, |
578 IPC::Message* reply_message) { | 579 IPC::Message* reply_message) { |
579 if (tab_tracker_->ContainsHandle(handle)) { | 580 if (tab_tracker_->ContainsHandle(handle)) { |
580 NavigationController* tab = tab_tracker_->GetResource(handle); | 581 NavigationController* tab = tab_tracker_->GetResource(handle); |
581 | 582 |
(...skipping 5755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6337 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 6338 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
6338 | 6339 |
6339 Send(reply_message_); | 6340 Send(reply_message_); |
6340 redirect_query_ = 0; | 6341 redirect_query_ = 0; |
6341 reply_message_ = NULL; | 6342 reply_message_ = NULL; |
6342 } | 6343 } |
6343 | 6344 |
6344 void TestingAutomationProvider::OnRemoveProvider() { | 6345 void TestingAutomationProvider::OnRemoveProvider() { |
6345 AutomationProviderList::GetInstance()->RemoveProvider(this); | 6346 AutomationProviderList::GetInstance()->RemoveProvider(this); |
6346 } | 6347 } |
OLD | NEW |