| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 13 #include "base/win/win_util.h" | 14 #include "base/win/win_util.h" |
| 14 #include "chrome/app/chrome_command_ids.h" | 15 #include "chrome/app/chrome_command_ids.h" |
| 15 #include "chrome/app/chrome_dll_resource.h" | 16 #include "chrome/app/chrome_dll_resource.h" |
| 16 #include "chrome/browser/automation/automation_provider.h" | 17 #include "chrome/browser/automation/automation_provider.h" |
| 17 #include "chrome/browser/debugger/devtools_toggle_action.h" | 18 #include "chrome/browser/debugger/devtools_toggle_action.h" |
| 18 #include "chrome/browser/debugger/devtools_window.h" | 19 #include "chrome/browser/debugger/devtools_window.h" |
| 19 #include "chrome/browser/google/google_util.h" | 20 #include "chrome/browser/google/google_util.h" |
| 20 #include "chrome/browser/history/history_types.h" | 21 #include "chrome/browser/history/history_types.h" |
| 21 #include "chrome/browser/history/history_tab_helper.h" | 22 #include "chrome/browser/history/history_tab_helper.h" |
| (...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 HACCEL accelerator_table = AtlLoadAccelerators(IDR_CHROMEFRAME); | 1093 HACCEL accelerator_table = AtlLoadAccelerators(IDR_CHROMEFRAME); |
| 1093 DCHECK(accelerator_table); | 1094 DCHECK(accelerator_table); |
| 1094 | 1095 |
| 1095 // We have to copy the table to access its contents. | 1096 // We have to copy the table to access its contents. |
| 1096 int count = CopyAcceleratorTable(accelerator_table, 0, 0); | 1097 int count = CopyAcceleratorTable(accelerator_table, 0, 0); |
| 1097 if (count == 0) { | 1098 if (count == 0) { |
| 1098 // Nothing to do in that case. | 1099 // Nothing to do in that case. |
| 1099 return; | 1100 return; |
| 1100 } | 1101 } |
| 1101 | 1102 |
| 1102 scoped_ptr<ACCEL> scoped_accelerators(new ACCEL[count]); | 1103 scoped_array<ACCEL> scoped_accelerators(new ACCEL[count]); |
| 1103 ACCEL* accelerators = scoped_accelerators.get(); | 1104 ACCEL* accelerators = scoped_accelerators.get(); |
| 1104 DCHECK(accelerators != NULL); | 1105 DCHECK(accelerators != NULL); |
| 1105 | 1106 |
| 1106 CopyAcceleratorTable(accelerator_table, accelerators, count); | 1107 CopyAcceleratorTable(accelerator_table, accelerators, count); |
| 1107 | 1108 |
| 1108 focus_manager_ = GetWidget()->GetFocusManager(); | 1109 focus_manager_ = GetWidget()->GetFocusManager(); |
| 1109 DCHECK(focus_manager_); | 1110 DCHECK(focus_manager_); |
| 1110 | 1111 |
| 1111 // Let's fill our own accelerator table. | 1112 // Let's fill our own accelerator table. |
| 1112 for (int i = 0; i < count; ++i) { | 1113 for (int i = 0; i < count; ++i) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 if (params.disposition == CURRENT_TAB) { | 1212 if (params.disposition == CURRENT_TAB) { |
| 1212 DCHECK(route_all_top_level_navigations_); | 1213 DCHECK(route_all_top_level_navigations_); |
| 1213 forward_params.disposition = NEW_FOREGROUND_TAB; | 1214 forward_params.disposition = NEW_FOREGROUND_TAB; |
| 1214 } | 1215 } |
| 1215 TabContents* new_contents = | 1216 TabContents* new_contents = |
| 1216 ExternalTabContainer::OpenURLFromTab(source, forward_params); | 1217 ExternalTabContainer::OpenURLFromTab(source, forward_params); |
| 1217 // support only one navigation for a dummy tab before it is killed. | 1218 // support only one navigation for a dummy tab before it is killed. |
| 1218 ::DestroyWindow(GetNativeView()); | 1219 ::DestroyWindow(GetNativeView()); |
| 1219 return new_contents; | 1220 return new_contents; |
| 1220 } | 1221 } |
| OLD | NEW |