Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: chrome/browser/external_tab_container_win.cc

Issue 9402018: Experimental Extension Keybinding (first cut). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/external_tab_container_win.h" 5 #include "chrome/browser/external_tab_container_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 const std::string& target) { 788 const std::string& target) {
789 if (automation_) { 789 if (automation_) {
790 automation_->Send(new AutomationMsg_ForwardMessageToExternalHost( 790 automation_->Send(new AutomationMsg_ForwardMessageToExternalHost(
791 tab_handle_, message, origin, target)); 791 tab_handle_, message, origin, target));
792 } 792 }
793 } 793 }
794 794
795 //////////////////////////////////////////////////////////////////////////////// 795 ////////////////////////////////////////////////////////////////////////////////
796 // ExternalTabContainer, NotificationObserver implementation: 796 // ExternalTabContainer, NotificationObserver implementation:
797 797
798 void ExternalTabContainer::Observe(int type, 798 void ExternalTabContainer::Observe(
799 const content::NotificationSource& source, 799 int type,
800 const content::NotificationDetails& details) { 800 const content::NotificationSource& source,
801 const content::NotificationDetails& details) {
801 if (!automation_) 802 if (!automation_)
802 return; 803 return;
803 804
804 static const int kHttpClientErrorStart = 400; 805 static const int kHttpClientErrorStart = 400;
805 static const int kHttpServerErrorEnd = 510; 806 static const int kHttpServerErrorEnd = 510;
806 807
807 switch (type) { 808 switch (type) {
808 case content::NOTIFICATION_LOAD_STOP: { 809 case content::NOTIFICATION_LOAD_STOP: {
809 const LoadNotificationDetails* load = 810 const LoadNotificationDetails* load =
810 content::Details<LoadNotificationDetails>(details).ptr(); 811 content::Details<LoadNotificationDetails>(details).ptr();
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 bool alt_down = (accelerators[i].fVirt & FALT) == FALT; 1113 bool alt_down = (accelerators[i].fVirt & FALT) == FALT;
1113 bool ctrl_down = (accelerators[i].fVirt & FCONTROL) == FCONTROL; 1114 bool ctrl_down = (accelerators[i].fVirt & FCONTROL) == FCONTROL;
1114 bool shift_down = (accelerators[i].fVirt & FSHIFT) == FSHIFT; 1115 bool shift_down = (accelerators[i].fVirt & FSHIFT) == FSHIFT;
1115 ui::Accelerator accelerator( 1116 ui::Accelerator accelerator(
1116 static_cast<ui::KeyboardCode>(accelerators[i].key), 1117 static_cast<ui::KeyboardCode>(accelerators[i].key),
1117 shift_down, ctrl_down, alt_down); 1118 shift_down, ctrl_down, alt_down);
1118 accelerator_table_[accelerator] = accelerators[i].cmd; 1119 accelerator_table_[accelerator] = accelerators[i].cmd;
1119 1120
1120 // Also register with the focus manager. 1121 // Also register with the focus manager.
1121 if (focus_manager_) 1122 if (focus_manager_)
1122 focus_manager_->RegisterAccelerator(accelerator, this); 1123 focus_manager_->RegisterAccelerator(accelerator, false, this);
1123 } 1124 }
1124 } 1125 }
1125 1126
1126 void ExternalTabContainer::OnReinitialize() { 1127 void ExternalTabContainer::OnReinitialize() {
1127 if (load_requests_via_automation_) { 1128 if (load_requests_via_automation_) {
1128 RenderViewHost* rvh = tab_contents_->web_contents()->GetRenderViewHost(); 1129 RenderViewHost* rvh = tab_contents_->web_contents()->GetRenderViewHost();
1129 if (rvh) { 1130 if (rvh) {
1130 AutomationResourceMessageFilter::ResumePendingRenderView( 1131 AutomationResourceMessageFilter::ResumePendingRenderView(
1131 rvh->process()->GetID(), rvh->routing_id(), 1132 rvh->process()->GetID(), rvh->routing_id(),
1132 tab_handle_, automation_resource_message_filter_); 1133 tab_handle_, automation_resource_message_filter_);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 if (params.disposition == CURRENT_TAB) { 1204 if (params.disposition == CURRENT_TAB) {
1204 DCHECK(route_all_top_level_navigations_); 1205 DCHECK(route_all_top_level_navigations_);
1205 forward_params.disposition = NEW_FOREGROUND_TAB; 1206 forward_params.disposition = NEW_FOREGROUND_TAB;
1206 } 1207 }
1207 WebContents* new_contents = 1208 WebContents* new_contents =
1208 ExternalTabContainer::OpenURLFromTab(source, forward_params); 1209 ExternalTabContainer::OpenURLFromTab(source, forward_params);
1209 // support only one navigation for a dummy tab before it is killed. 1210 // support only one navigation for a dummy tab before it is killed.
1210 ::DestroyWindow(GetNativeView()); 1211 ::DestroyWindow(GetNativeView());
1211 return new_contents; 1212 return new_contents;
1212 } 1213 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698