| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/external_tab_container.h" | 5 #include "chrome/browser/external_tab_container.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/win_util.h" | 10 #include "app/win_util.h" |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 void ExternalTabContainer::ForwardMessageToExternalHost( | 378 void ExternalTabContainer::ForwardMessageToExternalHost( |
| 379 const std::string& message, const std::string& origin, | 379 const std::string& message, const std::string& origin, |
| 380 const std::string& target) { | 380 const std::string& target) { |
| 381 if (automation_) { | 381 if (automation_) { |
| 382 automation_->Send( | 382 automation_->Send( |
| 383 new AutomationMsg_ForwardMessageToExternalHost(0, tab_handle_, | 383 new AutomationMsg_ForwardMessageToExternalHost(0, tab_handle_, |
| 384 message, origin, target)); | 384 message, origin, target)); |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 | 387 |
| 388 gfx::NativeWindow ExternalTabContainer::GetFrameNativeWindow() { |
| 389 return hwnd(); |
| 390 } |
| 391 |
| 388 bool ExternalTabContainer::TakeFocus(bool reverse) { | 392 bool ExternalTabContainer::TakeFocus(bool reverse) { |
| 389 if (automation_) { | 393 if (automation_) { |
| 390 automation_->Send(new AutomationMsg_TabbedOut(0, tab_handle_, | 394 automation_->Send(new AutomationMsg_TabbedOut(0, tab_handle_, |
| 391 win_util::IsShiftPressed())); | 395 win_util::IsShiftPressed())); |
| 392 } | 396 } |
| 393 | 397 |
| 394 return true; | 398 return true; |
| 395 } | 399 } |
| 396 | 400 |
| 397 bool ExternalTabContainer::CanDownload(int request_id) { | 401 bool ExternalTabContainer::CanDownload(int request_id) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 } | 674 } |
| 671 | 675 |
| 672 AutomationExtensionFunction::Enable(tab_contents_, functions_enabled); | 676 AutomationExtensionFunction::Enable(tab_contents_, functions_enabled); |
| 673 enabled_extension_automation_ = true; | 677 enabled_extension_automation_ = true; |
| 674 } else { | 678 } else { |
| 675 AutomationExtensionFunction::Disable(); | 679 AutomationExtensionFunction::Disable(); |
| 676 enabled_extension_automation_ = false; | 680 enabled_extension_automation_ = false; |
| 677 } | 681 } |
| 678 } | 682 } |
| 679 | 683 |
| 684 // ExternalTabContainer instances do not have a window. |
| 685 views::Window* ExternalTabContainer::GetWindow() { |
| 686 return NULL; |
| 687 } |
| 688 |
| 680 void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { | 689 void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { |
| 681 if (!tab_contents_) { | 690 if (!tab_contents_) { |
| 682 NOTREACHED(); | 691 NOTREACHED(); |
| 683 return; | 692 return; |
| 684 } | 693 } |
| 685 | 694 |
| 686 tab_contents_->controller().LoadURL(url, referrer, | 695 tab_contents_->controller().LoadURL(url, referrer, |
| 687 PageTransition::START_PAGE); | 696 PageTransition::START_PAGE); |
| 688 } | 697 } |
| 689 | 698 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 701 int tab_handle) { | 710 int tab_handle) { |
| 702 request_context_ = | 711 request_context_ = |
| 703 AutomationRequestContext::CreateAutomationURLRequestContextForTab( | 712 AutomationRequestContext::CreateAutomationURLRequestContextForTab( |
| 704 tab_handle, tab_contents_->profile(), | 713 tab_handle, tab_contents_->profile(), |
| 705 automation_resource_message_filter_); | 714 automation_resource_message_filter_); |
| 706 | 715 |
| 707 DCHECK(request_context_.get() != NULL); | 716 DCHECK(request_context_.get() != NULL); |
| 708 tab_contents_->set_request_context(request_context_.get()); | 717 tab_contents_->set_request_context(request_context_.get()); |
| 709 } | 718 } |
| 710 | 719 |
| OLD | NEW |