| 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/browser/automation/automation_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "app/message_box_flags.h" | 9 #include "app/message_box_flags.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 !service->GetExtensionById(extension->id(), false)) | 345 !service->GetExtensionById(extension->id(), false)) |
| 346 return extension; | 346 return extension; |
| 347 return NULL; | 347 return NULL; |
| 348 } | 348 } |
| 349 | 349 |
| 350 void AutomationProvider::OnChannelConnected(int pid) { | 350 void AutomationProvider::OnChannelConnected(int pid) { |
| 351 is_connected_ = true; | 351 is_connected_ = true; |
| 352 LOG(INFO) << "Testing channel connected, sending hello message"; | 352 LOG(INFO) << "Testing channel connected, sending hello message"; |
| 353 | 353 |
| 354 // Send a hello message with our current automation protocol version. | 354 // Send a hello message with our current automation protocol version. |
| 355 chrome::VersionInfo version_info; | 355 channel_->Send(new AutomationMsg_Hello(GetProtocolVersion())); |
| 356 channel_->Send(new AutomationMsg_Hello(version_info.Version())); | |
| 357 if (initial_loads_complete_) | 356 if (initial_loads_complete_) |
| 358 Send(new AutomationMsg_InitialLoadsComplete()); | 357 Send(new AutomationMsg_InitialLoadsComplete()); |
| 359 } | 358 } |
| 360 | 359 |
| 361 bool AutomationProvider::OnMessageReceived(const IPC::Message& message) { | 360 bool AutomationProvider::OnMessageReceived(const IPC::Message& message) { |
| 362 bool handled = true; | 361 bool handled = true; |
| 363 IPC_BEGIN_MESSAGE_MAP(AutomationProvider, message) | 362 IPC_BEGIN_MESSAGE_MAP(AutomationProvider, message) |
| 364 #if !defined(OS_MACOSX) | 363 #if !defined(OS_MACOSX) |
| 365 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WindowDrag, | 364 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WindowDrag, |
| 366 WindowSimulateDrag) | 365 WindowSimulateDrag) |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 } | 1029 } |
| 1031 } | 1030 } |
| 1032 } | 1031 } |
| 1033 | 1032 |
| 1034 void AutomationProvider::SaveAsAsync(int tab_handle) { | 1033 void AutomationProvider::SaveAsAsync(int tab_handle) { |
| 1035 NavigationController* tab = NULL; | 1034 NavigationController* tab = NULL; |
| 1036 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); | 1035 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); |
| 1037 if (tab_contents) | 1036 if (tab_contents) |
| 1038 tab_contents->OnSavePage(); | 1037 tab_contents->OnSavePage(); |
| 1039 } | 1038 } |
| OLD | NEW |