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

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

Issue 10823233: Close detached DevTools window (rather than open a new instance) when it receives an F12 keypress (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Return NULL as the ToggleDevToolsWindow() result for DevTools windows Created 8 years, 4 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/ui/views/external_tab_container_win.h" 5 #include "chrome/browser/ui/views/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 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 break; 1054 break;
1055 case IDC_ZOOM_NORMAL: 1055 case IDC_ZOOM_NORMAL:
1056 host->Zoom(content::PAGE_ZOOM_RESET); 1056 host->Zoom(content::PAGE_ZOOM_RESET);
1057 break; 1057 break;
1058 case IDC_ZOOM_MINUS: 1058 case IDC_ZOOM_MINUS:
1059 host->Zoom(content::PAGE_ZOOM_OUT); 1059 host->Zoom(content::PAGE_ZOOM_OUT);
1060 break; 1060 break;
1061 case IDC_DEV_TOOLS: 1061 case IDC_DEV_TOOLS:
1062 DevToolsWindow::ToggleDevToolsWindow( 1062 DevToolsWindow::ToggleDevToolsWindow(
1063 tab_contents_->web_contents()->GetRenderViewHost(), 1063 tab_contents_->web_contents()->GetRenderViewHost(),
1064 DEVTOOLS_TOGGLE_ACTION_NONE); 1064 DEVTOOLS_TOGGLE_ACTION_SHOW);
1065 break; 1065 break;
1066 case IDC_DEV_TOOLS_CONSOLE: 1066 case IDC_DEV_TOOLS_CONSOLE:
1067 DevToolsWindow::ToggleDevToolsWindow( 1067 DevToolsWindow::ToggleDevToolsWindow(
1068 tab_contents_->web_contents()->GetRenderViewHost(), 1068 tab_contents_->web_contents()->GetRenderViewHost(),
1069 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); 1069 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE);
1070 break; 1070 break;
1071 case IDC_DEV_TOOLS_INSPECT: 1071 case IDC_DEV_TOOLS_INSPECT:
1072 DevToolsWindow::ToggleDevToolsWindow( 1072 DevToolsWindow::ToggleDevToolsWindow(
1073 tab_contents_->web_contents()->GetRenderViewHost(), 1073 tab_contents_->web_contents()->GetRenderViewHost(),
1074 DEVTOOLS_TOGGLE_ACTION_INSPECT); 1074 DEVTOOLS_TOGGLE_ACTION_INSPECT);
1075 break; 1075 break;
1076 case IDC_DEV_TOOLS_TOGGLE:
1077 DevToolsWindow::ToggleDevToolsWindow(
1078 tab_contents_->web_contents()->GetRenderViewHost(),
1079 DEVTOOLS_TOGGLE_ACTION_TOGGLE);
1080 break;
1076 default: 1081 default:
1077 NOTREACHED() << "Unsupported accelerator: " << command_id; 1082 NOTREACHED() << "Unsupported accelerator: " << command_id;
1078 return false; 1083 return false;
1079 } 1084 }
1080 return true; 1085 return true;
1081 } 1086 }
1082 1087
1083 bool ExternalTabContainerWin::CanHandleAccelerators() const { 1088 bool ExternalTabContainerWin::CanHandleAccelerators() const {
1084 return true; 1089 return true;
1085 } 1090 }
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 if (params.disposition == CURRENT_TAB) { 1259 if (params.disposition == CURRENT_TAB) {
1255 DCHECK(route_all_top_level_navigations_); 1260 DCHECK(route_all_top_level_navigations_);
1256 forward_params.disposition = NEW_FOREGROUND_TAB; 1261 forward_params.disposition = NEW_FOREGROUND_TAB;
1257 } 1262 }
1258 WebContents* new_contents = 1263 WebContents* new_contents =
1259 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); 1264 ExternalTabContainerWin::OpenURLFromTab(source, forward_params);
1260 // support only one navigation for a dummy tab before it is killed. 1265 // support only one navigation for a dummy tab before it is killed.
1261 ::DestroyWindow(GetNativeView()); 1266 ::DestroyWindow(GetNativeView());
1262 return new_contents; 1267 return new_contents;
1263 } 1268 }
OLDNEW
« chrome/browser/debugger/devtools_window.cc ('K') | « chrome/browser/ui/views/accelerator_table.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698