| 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 4420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5910 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 5910 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
| 5911 | 5911 |
| 5912 Send(reply_message_); | 5912 Send(reply_message_); |
| 5913 redirect_query_ = 0; | 5913 redirect_query_ = 0; |
| 5914 reply_message_ = NULL; | 5914 reply_message_ = NULL; |
| 5915 } | 5915 } |
| 5916 | 5916 |
| 5917 void TestingAutomationProvider::OnRemoveProvider() { | 5917 void TestingAutomationProvider::OnRemoveProvider() { |
| 5918 AutomationProviderList::GetInstance()->RemoveProvider(this); | 5918 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 5919 } | 5919 } |
| OLD | NEW |