OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 void ExternalTabContainer::InfoBarContainerStateChanged(bool is_animating) { | 1029 void ExternalTabContainer::InfoBarContainerStateChanged(bool is_animating) { |
1030 if (external_tab_view_) | 1030 if (external_tab_view_) |
1031 external_tab_view_->Layout(); | 1031 external_tab_view_->Layout(); |
1032 } | 1032 } |
1033 | 1033 |
1034 bool ExternalTabContainer::DrawInfoBarArrows(int* x) const { | 1034 bool ExternalTabContainer::DrawInfoBarArrows(int* x) const { |
1035 return false; | 1035 return false; |
1036 } | 1036 } |
1037 | 1037 |
1038 bool ExternalTabContainer::AcceleratorPressed( | 1038 bool ExternalTabContainer::AcceleratorPressed( |
1039 const views::Accelerator& accelerator) { | 1039 const ui::Accelerator& accelerator) { |
1040 std::map<views::Accelerator, int>::const_iterator iter = | 1040 std::map<ui::Accelerator, int>::const_iterator iter = |
1041 accelerator_table_.find(accelerator); | 1041 accelerator_table_.find(accelerator); |
1042 DCHECK(iter != accelerator_table_.end()); | 1042 DCHECK(iter != accelerator_table_.end()); |
1043 | 1043 |
1044 if (!tab_contents_.get() || !tab_contents_->render_view_host()) { | 1044 if (!tab_contents_.get() || !tab_contents_->render_view_host()) { |
1045 NOTREACHED(); | 1045 NOTREACHED(); |
1046 return false; | 1046 return false; |
1047 } | 1047 } |
1048 | 1048 |
1049 RenderViewHost* host = tab_contents_->render_view_host(); | 1049 RenderViewHost* host = tab_contents_->render_view_host(); |
1050 int command_id = iter->second; | 1050 int command_id = iter->second; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 CopyAcceleratorTable(accelerator_table, accelerators, count); | 1120 CopyAcceleratorTable(accelerator_table, accelerators, count); |
1121 | 1121 |
1122 focus_manager_ = GetWidget()->GetFocusManager(); | 1122 focus_manager_ = GetWidget()->GetFocusManager(); |
1123 DCHECK(focus_manager_); | 1123 DCHECK(focus_manager_); |
1124 | 1124 |
1125 // Let's fill our own accelerator table. | 1125 // Let's fill our own accelerator table. |
1126 for (int i = 0; i < count; ++i) { | 1126 for (int i = 0; i < count; ++i) { |
1127 bool alt_down = (accelerators[i].fVirt & FALT) == FALT; | 1127 bool alt_down = (accelerators[i].fVirt & FALT) == FALT; |
1128 bool ctrl_down = (accelerators[i].fVirt & FCONTROL) == FCONTROL; | 1128 bool ctrl_down = (accelerators[i].fVirt & FCONTROL) == FCONTROL; |
1129 bool shift_down = (accelerators[i].fVirt & FSHIFT) == FSHIFT; | 1129 bool shift_down = (accelerators[i].fVirt & FSHIFT) == FSHIFT; |
1130 views::Accelerator accelerator( | 1130 ui::Accelerator accelerator( |
1131 static_cast<ui::KeyboardCode>(accelerators[i].key), | 1131 static_cast<ui::KeyboardCode>(accelerators[i].key), |
1132 shift_down, ctrl_down, alt_down); | 1132 shift_down, ctrl_down, alt_down); |
1133 accelerator_table_[accelerator] = accelerators[i].cmd; | 1133 accelerator_table_[accelerator] = accelerators[i].cmd; |
1134 | 1134 |
1135 // Also register with the focus manager. | 1135 // Also register with the focus manager. |
1136 if (focus_manager_) | 1136 if (focus_manager_) |
1137 focus_manager_->RegisterAccelerator(accelerator, this); | 1137 focus_manager_->RegisterAccelerator(accelerator, this); |
1138 } | 1138 } |
1139 } | 1139 } |
1140 | 1140 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 if (params.disposition == CURRENT_TAB) { | 1226 if (params.disposition == CURRENT_TAB) { |
1227 DCHECK(route_all_top_level_navigations_); | 1227 DCHECK(route_all_top_level_navigations_); |
1228 forward_params.disposition = NEW_FOREGROUND_TAB; | 1228 forward_params.disposition = NEW_FOREGROUND_TAB; |
1229 } | 1229 } |
1230 TabContents* new_contents = | 1230 TabContents* new_contents = |
1231 ExternalTabContainer::OpenURLFromTab(source, forward_params); | 1231 ExternalTabContainer::OpenURLFromTab(source, forward_params); |
1232 // support only one navigation for a dummy tab before it is killed. | 1232 // support only one navigation for a dummy tab before it is killed. |
1233 ::DestroyWindow(GetNativeView()); | 1233 ::DestroyWindow(GetNativeView()); |
1234 return new_contents; | 1234 return new_contents; |
1235 } | 1235 } |
OLD | NEW |