OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/keyboard_codes.h" | 7 #include "base/keyboard_codes.h" |
8 #include "chrome/browser/automation/ui_controls.h" | 8 #include "chrome/browser/automation/ui_controls.h" |
9 #include "chrome/browser/browser_window.h" | 9 #include "chrome/browser/browser_window.h" |
10 #include "chrome/browser/external_tab_container.h" | 10 #include "chrome/browser/external_tab_container.h" |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 | 483 |
484 void AutomationProvider::TerminateSession(int handle, bool* success) { | 484 void AutomationProvider::TerminateSession(int handle, bool* success) { |
485 *success = false; | 485 *success = false; |
486 | 486 |
487 if (browser_tracker_->ContainsHandle(handle)) { | 487 if (browser_tracker_->ContainsHandle(handle)) { |
488 Browser* browser = browser_tracker_->GetResource(handle); | 488 Browser* browser = browser_tracker_->GetResource(handle); |
489 HWND window = browser->window()->GetNativeHandle(); | 489 HWND window = browser->window()->GetNativeHandle(); |
490 *success = (::PostMessageW(window, WM_ENDSESSION, 0, 0) == TRUE); | 490 *success = (::PostMessageW(window, WM_ENDSESSION, 0, 0) == TRUE); |
491 } | 491 } |
492 } | 492 } |
| 493 |
| 494 void AutomationProvider::SetEnableExtensionAutomation( |
| 495 int tab_handle, |
| 496 const std::vector<std::string>& functions_enabled) { |
| 497 ExternalTabContainer* external_tab = GetExternalTabForHandle(tab_handle); |
| 498 if (external_tab) { |
| 499 external_tab->SetEnableExtensionAutomation(functions_enabled); |
| 500 } else { |
| 501 // Tab must exist, and must be an external tab so that its |
| 502 // delegate has an on-empty |
| 503 // implementation of ForwardMessageToExternalHost. |
| 504 DLOG(WARNING) << |
| 505 "SetEnableExtensionAutomation called with invalid tab handle."; |
| 506 } |
| 507 } |
OLD | NEW |