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/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 "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 bool AutomationProvider::Send(IPC::Message* msg) { | 464 bool AutomationProvider::Send(IPC::Message* msg) { |
465 DCHECK(channel_.get()); | 465 DCHECK(channel_.get()); |
466 return channel_->Send(msg); | 466 return channel_->Send(msg); |
467 } | 467 } |
468 | 468 |
469 Browser* AutomationProvider::FindAndActivateTab( | 469 Browser* AutomationProvider::FindAndActivateTab( |
470 NavigationController* controller) { | 470 NavigationController* controller) { |
471 content::WebContentsDelegate* d = controller->GetWebContents()->GetDelegate(); | 471 content::WebContentsDelegate* d = controller->GetWebContents()->GetDelegate(); |
472 if (d) | 472 if (d) |
473 d->ActivateContents(controller->GetWebContents()); | 473 d->ActivateContents(controller->GetWebContents()); |
474 return browser::FindBrowserWithWebContents(controller->GetWebContents()); | 474 return chrome::FindBrowserWithWebContents(controller->GetWebContents()); |
475 } | 475 } |
476 | 476 |
477 void AutomationProvider::HandleFindRequest( | 477 void AutomationProvider::HandleFindRequest( |
478 int handle, | 478 int handle, |
479 const AutomationMsg_Find_Params& params, | 479 const AutomationMsg_Find_Params& params, |
480 IPC::Message* reply_message) { | 480 IPC::Message* reply_message) { |
481 if (!tab_tracker_->ContainsHandle(handle)) { | 481 if (!tab_tracker_->ContainsHandle(handle)) { |
482 AutomationMsg_Find::WriteReplyParams(reply_message, -1, -1); | 482 AutomationMsg_Find::WriteReplyParams(reply_message, -1, -1); |
483 Send(reply_message); | 483 Send(reply_message); |
484 return; | 484 return; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 | 747 |
748 return NULL; | 748 return NULL; |
749 } | 749 } |
750 | 750 |
751 void AutomationProvider::SaveAsAsync(int tab_handle) { | 751 void AutomationProvider::SaveAsAsync(int tab_handle) { |
752 NavigationController* tab = NULL; | 752 NavigationController* tab = NULL; |
753 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); | 753 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); |
754 if (web_contents) | 754 if (web_contents) |
755 web_contents->OnSavePage(); | 755 web_contents->OnSavePage(); |
756 } | 756 } |
OLD | NEW |