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 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 NavigationController* tab = NULL; | 1469 NavigationController* tab = NULL; |
1470 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); | 1470 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); |
1471 if (tab_contents) { | 1471 if (tab_contents) { |
1472 FindAndActivateTab(tab); | 1472 FindAndActivateTab(tab); |
1473 | 1473 |
1474 NotificationObserver* observer = | 1474 NotificationObserver* observer = |
1475 new DocumentPrintedNotificationObserver(this, reply_message); | 1475 new DocumentPrintedNotificationObserver(this, reply_message); |
1476 | 1476 |
1477 TabContentsWrapper* wrapper = | 1477 TabContentsWrapper* wrapper = |
1478 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); | 1478 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); |
1479 if (!wrapper->print_view_manager()->PrintNow()) { | 1479 if (!wrapper->print_view_manager()->PrintNow(NULL)) { |
1480 // Clean up the observer. It will send the reply message. | 1480 // Clean up the observer. It will send the reply message. |
1481 delete observer; | 1481 delete observer; |
1482 } | 1482 } |
1483 | 1483 |
1484 // Return now to avoid sending reply message twice. | 1484 // Return now to avoid sending reply message twice. |
1485 return; | 1485 return; |
1486 } | 1486 } |
1487 | 1487 |
1488 AutomationMsg_PrintNow::WriteReplyParams(reply_message, false); | 1488 AutomationMsg_PrintNow::WriteReplyParams(reply_message, false); |
1489 Send(reply_message); | 1489 Send(reply_message); |
(...skipping 4418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5908 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 5908 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
5909 | 5909 |
5910 Send(reply_message_); | 5910 Send(reply_message_); |
5911 redirect_query_ = 0; | 5911 redirect_query_ = 0; |
5912 reply_message_ = NULL; | 5912 reply_message_ = NULL; |
5913 } | 5913 } |
5914 | 5914 |
5915 void TestingAutomationProvider::OnRemoveProvider() { | 5915 void TestingAutomationProvider::OnRemoveProvider() { |
5916 AutomationProviderList::GetInstance()->RemoveProvider(this); | 5916 AutomationProviderList::GetInstance()->RemoveProvider(this); |
5917 } | 5917 } |
OLD | NEW |