summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorapavlov@chromium.org <apavlov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 11:58:48 +0000
committerapavlov@chromium.org <apavlov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 11:58:48 +0000
commit2a8a98126b0115e0f3d137668c67b90a399f72bf (patch)
treeac1eedcdf0439b6c867cdce638d8a512d7cabaee /chrome
parent8664dfb1f41cb9c51e50b3f7c4d78b24d29408d8 (diff)
downloadchromium_src-2a8a98126b0115e0f3d137668c67b90a399f72bf.zip
chromium_src-2a8a98126b0115e0f3d137668c67b90a399f72bf.tar.gz
chromium_src-2a8a98126b0115e0f3d137668c67b90a399f72bf.tar.bz2
Add "Inspect Element" shortcut to browser tabs.
If the DevTools window is closed, it gets opened, and the Inspect Element tool is enabled. If the DevTools window is opened, the inspected tab remains focused with the Inspect Element tool enabled. If the Inspect Element tool is enabled, it gets turned off. The shortcut is Ctrl-Shift-C for Win/Linux, Cmd-Shift-C for Mac BUG=29532 TEST=manual Review URL: http://codereview.chromium.org/3011002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52651 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/chrome_dll.rc2
-rw-r--r--chrome/app/chrome_dll_resource.h1
-rw-r--r--chrome/browser/browser.cc35
-rw-r--r--chrome/browser/browser.h3
-rw-r--r--chrome/browser/debugger/devtools_manager.cc24
-rw-r--r--chrome/browser/debugger/devtools_manager.h6
-rw-r--r--chrome/browser/debugger/devtools_toggle_action.h14
-rw-r--r--chrome/browser/debugger/devtools_window.cc58
-rw-r--r--chrome/browser/debugger/devtools_window.h9
-rw-r--r--chrome/browser/extensions/extensions_ui.cc5
-rw-r--r--chrome/browser/external_tab_container_win.cc11
-rw-r--r--chrome/browser/global_keyboard_shortcuts_mac.mm9
-rw-r--r--chrome/browser/gtk/accelerators_gtk.cc2
-rw-r--r--chrome/browser/views/accelerator_table_gtk.cc1
-rw-r--r--chrome/browser/views/extensions/extension_popup.cc4
-rw-r--r--chrome/chrome.gyp1
16 files changed, 130 insertions, 55 deletions
diff --git a/chrome/app/chrome_dll.rc b/chrome/app/chrome_dll.rc
index 1ab9514..d56cf87 100644
--- a/chrome/app/chrome_dll.rc
+++ b/chrome/app/chrome_dll.rc
@@ -61,6 +61,7 @@ BEGIN
VK_F1, IDC_HELP_PAGE, VIRTKEY
"I", IDC_DEV_TOOLS, VIRTKEY, CONTROL, SHIFT
"J", IDC_DEV_TOOLS_CONSOLE, VIRTKEY, CONTROL, SHIFT
+ "C", IDC_DEV_TOOLS_INSPECT, VIRTKEY, CONTROL, SHIFT
"N", IDC_NEW_INCOGNITO_WINDOW, VIRTKEY, CONTROL, SHIFT
"T", IDC_NEW_TAB, VIRTKEY, CONTROL
"N", IDC_NEW_WINDOW, VIRTKEY, CONTROL
@@ -122,6 +123,7 @@ IDR_CHROMEFRAME ACCELERATORS
BEGIN
"I", IDC_DEV_TOOLS, VIRTKEY, CONTROL, SHIFT
"J", IDC_DEV_TOOLS_CONSOLE, VIRTKEY, CONTROL, SHIFT
+ "C", IDC_DEV_TOOLS_INSPECT, VIRTKEY, CONTROL, SHIFT
VK_OEM_MINUS, IDC_ZOOM_MINUS, VIRTKEY, CONTROL
VK_OEM_MINUS, IDC_ZOOM_MINUS, VIRTKEY, CONTROL, SHIFT
VK_SUBTRACT, IDC_ZOOM_MINUS, VIRTKEY, CONTROL
diff --git a/chrome/app/chrome_dll_resource.h b/chrome/app/chrome_dll_resource.h
index b9991f3..0029c03 100644
--- a/chrome/app/chrome_dll_resource.h
+++ b/chrome/app/chrome_dll_resource.h
@@ -210,6 +210,7 @@
#define IDC_SHOW_EXTENSION_SHELF 40022
#define IDC_MANAGE_EXTENSIONS 40023
#define IDC_AUTOFILL_DEFAULT 40024
+#define IDC_DEV_TOOLS_INSPECT 40025
// Spell-check
// Insert any additional suggestions before _LAST; these have to be consecutive.
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index c4a25df..dd8abe1 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -33,6 +33,7 @@
#include "chrome/browser/browser_url_handler.h"
#include "chrome/browser/character_encoding.h"
#include "chrome/browser/debugger/devtools_manager.h"
+#include "chrome/browser/debugger/devtools_toggle_action.h"
#include "chrome/browser/debugger/devtools_window.h"
#include "chrome/browser/dock_info.h"
#include "chrome/browser/dom_ui/filebrowse_ui.h"
@@ -1669,15 +1670,21 @@ void Browser::OpenCreateShortcutsDialog() {
#endif
}
-void Browser::ToggleDevToolsWindow(bool open_console) {
- if (open_console)
- UserMetrics::RecordAction(UserMetricsAction("DevTools_ToggleConsole"),
- profile_);
- else
- UserMetrics::RecordAction(UserMetricsAction("DevTools_ToggleWindow"),
- profile_);
+void Browser::ToggleDevToolsWindow(DevToolsToggleAction action) {
+ std::string uma_string;
+ switch (action) {
+ case DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE:
+ uma_string = "DevTools_ToggleConsole";
+ break;
+ case DEVTOOLS_TOGGLE_ACTION_NONE:
+ case DEVTOOLS_TOGGLE_ACTION_INSPECT:
+ default:
+ uma_string = "DevTools_ToggleWindow";
+ break;
+ }
+ UserMetrics::RecordAction(UserMetricsAction(uma_string.c_str()), profile_);
DevToolsManager::GetInstance()->ToggleDevToolsWindow(
- GetSelectedTabContents()->render_view_host(), open_console);
+ GetSelectedTabContents()->render_view_host(), action);
}
void Browser::OpenTaskManager() {
@@ -2085,8 +2092,15 @@ void Browser::ExecuteCommandWithDisposition(
// Show various bits of UI
case IDC_OPEN_FILE: OpenFile(); break;
case IDC_CREATE_SHORTCUTS: OpenCreateShortcutsDialog(); break;
- case IDC_DEV_TOOLS: ToggleDevToolsWindow(false); break;
- case IDC_DEV_TOOLS_CONSOLE: ToggleDevToolsWindow(true); break;
+ case IDC_DEV_TOOLS: ToggleDevToolsWindow(
+ DEVTOOLS_TOGGLE_ACTION_NONE);
+ break;
+ case IDC_DEV_TOOLS_CONSOLE: ToggleDevToolsWindow(
+ DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE);
+ break;
+ case IDC_DEV_TOOLS_INSPECT: ToggleDevToolsWindow(
+ DEVTOOLS_TOGGLE_ACTION_INSPECT);
+ break;
case IDC_TASK_MANAGER: OpenTaskManager(); break;
case IDC_REPORT_BUG: OpenBugReportDialog(); break;
@@ -3164,6 +3178,7 @@ void Browser::InitCommandState() {
command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false);
command_updater_.UpdateCommandEnabled(IDC_DEV_TOOLS, true);
command_updater_.UpdateCommandEnabled(IDC_DEV_TOOLS_CONSOLE, true);
+ command_updater_.UpdateCommandEnabled(IDC_DEV_TOOLS_INSPECT, true);
command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, true);
command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true);
command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER, true);
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 6825a2c..0a8e4ce 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -13,6 +13,7 @@
#include "base/gtest_prod_util.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/command_updater.h"
+#include "chrome/browser/debugger/devtools_toggle_action.h"
#include "chrome/browser/pref_member.h"
#include "chrome/browser/sessions/session_id.h"
#include "chrome/browser/sessions/tab_restore_service.h"
@@ -496,7 +497,7 @@ class Browser : public TabStripModelDelegate,
// Show various bits of UI
void OpenFile();
void OpenCreateShortcutsDialog();
- void ToggleDevToolsWindow(bool open_console);
+ void ToggleDevToolsWindow(DevToolsToggleAction action);
void OpenTaskManager();
void OpenBugReportDialog();
diff --git a/chrome/browser/debugger/devtools_manager.cc b/chrome/browser/debugger/devtools_manager.cc
index 2965478..6b958cc 100644
--- a/chrome/browser/debugger/devtools_manager.cc
+++ b/chrome/browser/debugger/devtools_manager.cc
@@ -131,12 +131,16 @@ void DevToolsManager::RequestUndockWindow(RenderViewHost* client_rvh) {
}
void DevToolsManager::OpenDevToolsWindow(RenderViewHost* inspected_rvh) {
- ToggleDevToolsWindow(inspected_rvh, true, false);
+ ToggleDevToolsWindow(
+ inspected_rvh,
+ true,
+ DEVTOOLS_TOGGLE_ACTION_NONE);
}
-void DevToolsManager::ToggleDevToolsWindow(RenderViewHost* inspected_rvh,
- bool open_console) {
- ToggleDevToolsWindow(inspected_rvh, false, open_console);
+void DevToolsManager::ToggleDevToolsWindow(
+ RenderViewHost* inspected_rvh,
+ DevToolsToggleAction action) {
+ ToggleDevToolsWindow(inspected_rvh, false, action);
}
void DevToolsManager::RuntimeFeatureStateChanged(RenderViewHost* inspected_rvh,
@@ -345,9 +349,10 @@ void DevToolsManager::ReopenWindow(RenderViewHost* client_rvh, bool docked) {
window->SetDocked(docked);
}
-void DevToolsManager::ToggleDevToolsWindow(RenderViewHost* inspected_rvh,
- bool force_open,
- bool open_console) {
+void DevToolsManager::ToggleDevToolsWindow(
+ RenderViewHost* inspected_rvh,
+ bool force_open,
+ DevToolsToggleAction action) {
bool do_open = force_open;
DevToolsClientHost* host = GetDevToolsClientHostFor(inspected_rvh);
if (!host) {
@@ -368,9 +373,10 @@ void DevToolsManager::ToggleDevToolsWindow(RenderViewHost* inspected_rvh,
// undocked, we show (activate) it.
if (!window->is_docked() || do_open) {
AutoReset<bool> auto_reset_in_initial_show(&in_initial_show_, true);
- window->Show(open_console);
- } else
+ window->Show(action);
+ } else {
UnregisterDevToolsClientHostFor(inspected_rvh);
+ }
}
void DevToolsManager::BindClientHost(RenderViewHost* inspected_rvh,
diff --git a/chrome/browser/debugger/devtools_manager.h b/chrome/browser/debugger/devtools_manager.h
index 46b5ea6..20835af 100644
--- a/chrome/browser/debugger/devtools_manager.h
+++ b/chrome/browser/debugger/devtools_manager.h
@@ -11,6 +11,7 @@
#include "base/ref_counted.h"
#include "chrome/browser/debugger/devtools_client_host.h"
+#include "chrome/browser/debugger/devtools_toggle_action.h"
namespace IPC {
class Message;
@@ -54,7 +55,8 @@ class DevToolsManager : public DevToolsClientHost::CloseListener,
void RequestUndockWindow(RenderViewHost* client_rvn);
void OpenDevToolsWindow(RenderViewHost* inspected_rvh);
- void ToggleDevToolsWindow(RenderViewHost* inspected_rvh, bool open_console);
+ void ToggleDevToolsWindow(RenderViewHost* inspected_rvh,
+ DevToolsToggleAction action);
void RuntimeFeatureStateChanged(RenderViewHost* inspected_rvh,
const std::string& feature,
bool enabled);
@@ -103,7 +105,7 @@ class DevToolsManager : public DevToolsClientHost::CloseListener,
void ToggleDevToolsWindow(RenderViewHost* inspected_rvh,
bool force_open,
- bool open_console);
+ DevToolsToggleAction action);
void ReopenWindow(RenderViewHost* client_rvh, bool docked);
diff --git a/chrome/browser/debugger/devtools_toggle_action.h b/chrome/browser/debugger/devtools_toggle_action.h
new file mode 100644
index 0000000..a8c4c53
--- /dev/null
+++ b/chrome/browser/debugger/devtools_toggle_action.h
@@ -0,0 +1,14 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DEBUGGER_DEVTOOLS_TOGGLE_ACTION_H_
+#define CHROME_BROWSER_DEBUGGER_DEVTOOLS_TOGGLE_ACTION_H_
+
+enum DevToolsToggleAction {
+ DEVTOOLS_TOGGLE_ACTION_NONE,
+ DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE,
+ DEVTOOLS_TOGGLE_ACTION_INSPECT
+};
+
+#endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_TOGGLE_ACTION_H_
diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc
index 56541e7..fc74431 100644
--- a/chrome/browser/debugger/devtools_window.cc
+++ b/chrome/browser/debugger/devtools_window.cc
@@ -57,11 +57,12 @@ DevToolsWindow::DevToolsWindow(Profile* profile,
browser_(NULL),
docked_(docked),
is_loaded_(false),
- open_console_on_load_(false) {
+ action_on_load_(DEVTOOLS_TOGGLE_ACTION_NONE) {
// Create TabContents with devtools.
tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL);
tab_contents_->render_view_host()->AllowBindings(BindingsPolicy::DOM_UI);
- tab_contents_->controller().LoadURL(GetDevToolsUrl(), GURL(), PageTransition::START_PAGE);
+ tab_contents_->controller().LoadURL(
+ GetDevToolsUrl(), GURL(), PageTransition::START_PAGE);
// Wipe out page icon so that the default application icon is used.
NavigationEntry* entry = tab_contents_->controller().GetActiveEntry();
@@ -115,7 +116,7 @@ void DevToolsWindow::InspectedTabClosing() {
}
}
-void DevToolsWindow::Show(bool open_console) {
+void DevToolsWindow::Show(DevToolsToggleAction action) {
if (docked_) {
// Just tell inspected browser to update splitter.
BrowserWindow* inspected_window = GetInspectedBrowserWindow();
@@ -124,8 +125,7 @@ void DevToolsWindow::Show(bool open_console) {
inspected_window->UpdateDevTools();
SetAttachedWindow();
tab_contents_->view()->SetInitialFocus();
- if (open_console)
- ScheduleOpenConsole();
+ ScheduleAction(action);
return;
} else {
// Sometimes we don't know where to dock. Stay undocked.
@@ -136,12 +136,17 @@ void DevToolsWindow::Show(bool open_console) {
if (!browser_)
CreateDevToolsBrowser();
- browser_->window()->Show();
+ // Avoid consecutive window switching if the devtools window has been opened
+ // and the Inspect Element shortcut is pressed in the inspected tab.
+ bool should_show_window =
+ !browser_ || action != DEVTOOLS_TOGGLE_ACTION_INSPECT;
+ if (should_show_window)
+ browser_->window()->Show();
SetAttachedWindow();
- tab_contents_->view()->SetInitialFocus();
+ if (should_show_window)
+ tab_contents_->view()->SetInitialFocus();
- if (open_console)
- ScheduleOpenConsole();
+ ScheduleAction(action);
}
void DevToolsWindow::Activate() {
@@ -180,7 +185,7 @@ void DevToolsWindow::SetDocked(bool docked) {
inspected_window = NULL;
}
}
- Show(false);
+ Show(DEVTOOLS_TOGGLE_ACTION_NONE);
}
RenderViewHost* DevToolsWindow::GetRenderViewHost() {
@@ -244,10 +249,7 @@ void DevToolsWindow::Observe(NotificationType type,
SetAttachedWindow();
is_loaded_ = true;
UpdateTheme();
- if (open_console_on_load_) {
- DoOpenConsole();
- open_console_on_load_ = false;
- }
+ DoAction();
} else if (type == NotificationType::TAB_CLOSING) {
if (Source<NavigationController>(source).ptr() ==
&tab_contents_->controller()) {
@@ -263,16 +265,30 @@ void DevToolsWindow::Observe(NotificationType type,
}
}
-void DevToolsWindow::ScheduleOpenConsole() {
+void DevToolsWindow::ScheduleAction(DevToolsToggleAction action) {
+ action_on_load_ = action;
if (is_loaded_)
- DoOpenConsole();
- else
- open_console_on_load_ = true;
+ DoAction();
}
-void DevToolsWindow::DoOpenConsole() {
- tab_contents_->render_view_host()->
- ExecuteJavascriptInWebFrame(L"", L"WebInspector.showConsole();");
+void DevToolsWindow::DoAction() {
+ // TODO: these messages should be pushed through the WebKit API instead.
+ switch (action_on_load_) {
+ case DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE:
+ tab_contents_->render_view_host()->
+ ExecuteJavascriptInWebFrame(L"", L"WebInspector.showConsole();");
+ break;
+ case DEVTOOLS_TOGGLE_ACTION_INSPECT:
+ tab_contents_->render_view_host()->
+ ExecuteJavascriptInWebFrame(
+ L"", L"WebInspector.toggleSearchingForNode();");
+ case DEVTOOLS_TOGGLE_ACTION_NONE:
+ // Do nothing.
+ break;
+ default:
+ NOTREACHED();
+ }
+ action_on_load_ = DEVTOOLS_TOGGLE_ACTION_NONE;
}
std::string SkColorToRGBAString(SkColor color) {
diff --git a/chrome/browser/debugger/devtools_window.h b/chrome/browser/debugger/devtools_window.h
index fbd14dc..0bdcd67 100644
--- a/chrome/browser/debugger/devtools_window.h
+++ b/chrome/browser/debugger/devtools_window.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/debugger/devtools_client_host.h"
+#include "chrome/browser/debugger/devtools_toggle_action.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/common/notification_service.h"
@@ -40,7 +41,7 @@ class DevToolsWindow
virtual void SendMessageToClient(const IPC::Message& message);
virtual void InspectedTabClosing();
- void Show(bool open_console);
+ void Show(DevToolsToggleAction action);
void Activate();
void SetDocked(bool docked);
RenderViewHost* GetRenderViewHost();
@@ -59,8 +60,8 @@ class DevToolsWindow
const NotificationSource& source,
const NotificationDetails& details);
- void ScheduleOpenConsole();
- void DoOpenConsole();
+ void ScheduleAction(DevToolsToggleAction action);
+ void DoAction();
GURL GetDevToolsUrl();
void UpdateTheme();
@@ -96,7 +97,7 @@ class DevToolsWindow
Browser* browser_;
bool docked_;
bool is_loaded_;
- bool open_console_on_load_;
+ DevToolsToggleAction action_on_load_;
NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(DevToolsWindow);
};
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc
index c4c55ec..24ca842 100644
--- a/chrome/browser/extensions/extensions_ui.cc
+++ b/chrome/browser/extensions/extensions_ui.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/debugger/devtools_manager.h"
+#include "chrome/browser/debugger/devtools_toggle_action.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/extension_disabled_infobar_delegate.h"
#include "chrome/browser/extensions/extension_error_reporter.h"
@@ -436,7 +437,9 @@ void ExtensionsDOMHandler::HandleInspectMessage(const Value* value) {
return;
}
- DevToolsManager::GetInstance()->ToggleDevToolsWindow(host, true);
+ DevToolsManager::GetInstance()->ToggleDevToolsWindow(
+ host,
+ DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE);
}
void ExtensionsDOMHandler::HandleReloadMessage(const Value* value) {
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc
index 7d12555..106ad30 100644
--- a/chrome/browser/external_tab_container_win.cc
+++ b/chrome/browser/external_tab_container_win.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/automation/automation_extension_function.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/debugger/devtools_manager.h"
+#include "chrome/browser/debugger/devtools_toggle_action.h"
#include "chrome/browser/load_notification_details.h"
#include "chrome/browser/page_info_window.h"
#include "chrome/browser/profile.h"
@@ -827,11 +828,17 @@ bool ExternalTabContainer::AcceleratorPressed(
break;
case IDC_DEV_TOOLS:
DevToolsManager::GetInstance()->ToggleDevToolsWindow(
- tab_contents_->render_view_host(), false);
+ tab_contents_->render_view_host(), DEVTOOLS_TOGGLE_ACTION_NONE);
break;
case IDC_DEV_TOOLS_CONSOLE:
DevToolsManager::GetInstance()->ToggleDevToolsWindow(
- tab_contents_->render_view_host(), true);
+ tab_contents_->render_view_host(),
+ DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE);
+ break;
+ case IDC_DEV_TOOLS_INSPECT:
+ DevToolsManager::GetInstance()->ToggleDevToolsWindow(
+ tab_contents_->render_view_host(),
+ DEVTOOLS_TOGGLE_ACTION_INSPECT);
break;
default:
NOTREACHED() << "Unsupported accelerator: " << command_id;
diff --git a/chrome/browser/global_keyboard_shortcuts_mac.mm b/chrome/browser/global_keyboard_shortcuts_mac.mm
index f40e91c..38b5636 100644
--- a/chrome/browser/global_keyboard_shortcuts_mac.mm
+++ b/chrome/browser/global_keyboard_shortcuts_mac.mm
@@ -61,10 +61,11 @@ const KeyboardShortcutData* GetDelayedWindowKeyboardShortcutTable
const KeyboardShortcutData* GetBrowserKeyboardShortcutTable
(size_t* num_entries) {
static const KeyboardShortcutData keyboard_shortcuts[] = {
- {true, false, false, false, kVK_LeftArrow, 0, IDC_BACK},
- {true, false, false, false, kVK_RightArrow, 0, IDC_FORWARD},
- {false, false, false, false, kVK_Delete, 0, IDC_BACK},
- {false, true, false, false, kVK_Delete, 0, IDC_FORWARD},
+ {true, false, false, false, kVK_LeftArrow, 0, IDC_BACK},
+ {true, false, false, false, kVK_RightArrow, 0, IDC_FORWARD},
+ {false, false, false, false, kVK_Delete, 0, IDC_BACK},
+ {false, true, false, false, kVK_Delete, 0, IDC_FORWARD},
+ {true, true, false, false, 0, 'c', IDC_DEV_TOOLS_INSPECT},
};
*num_entries = arraysize(keyboard_shortcuts);
diff --git a/chrome/browser/gtk/accelerators_gtk.cc b/chrome/browser/gtk/accelerators_gtk.cc
index c93d8f0..aff2876 100644
--- a/chrome/browser/gtk/accelerators_gtk.cc
+++ b/chrome/browser/gtk/accelerators_gtk.cc
@@ -133,6 +133,8 @@ const struct AcceleratorMapping {
GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) },
{ GDK_j, IDC_DEV_TOOLS_CONSOLE,
GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) },
+ { GDK_c, IDC_DEV_TOOLS_INSPECT,
+ GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) },
{ GDK_Escape, IDC_TASK_MANAGER, GDK_SHIFT_MASK },
// Editing.
diff --git a/chrome/browser/views/accelerator_table_gtk.cc b/chrome/browser/views/accelerator_table_gtk.cc
index 5bc2179..e7be904 100644
--- a/chrome/browser/views/accelerator_table_gtk.cc
+++ b/chrome/browser/views/accelerator_table_gtk.cc
@@ -145,6 +145,7 @@ const AcceleratorMapping kAcceleratorMap[] = {
{ base::VKEY_U, false, true, false, IDC_VIEW_SOURCE },
{ base::VKEY_I, true, true, false, IDC_DEV_TOOLS },
{ base::VKEY_J, true, true, false, IDC_DEV_TOOLS_CONSOLE },
+ { base::VKEY_C, true, true, false, IDC_DEV_TOOLS_INSPECT },
{ base::VKEY_P, false, true, false, IDC_PRINT},
{ base::VKEY_ESCAPE, true, false, false, IDC_TASK_MANAGER },
#if !defined(OS_CHROMEOS)
diff --git a/chrome/browser/views/extensions/extension_popup.cc b/chrome/browser/views/extensions/extension_popup.cc
index 4ad6acc..a669d69 100644
--- a/chrome/browser/views/extensions/extension_popup.cc
+++ b/chrome/browser/views/extensions/extension_popup.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/debugger/devtools_manager.h"
+#include "chrome/browser/debugger/devtools_toggle_action.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/profile.h"
@@ -255,7 +256,8 @@ void ExtensionPopup::Observe(NotificationType type,
registrar_.Add(this, NotificationType::DEVTOOLS_WINDOW_CLOSING,
Source<Profile>(extension_host_->profile()));
DevToolsManager::GetInstance()->ToggleDevToolsWindow(
- extension_host_->render_view_host(), true);
+ extension_host_->render_view_host(),
+ DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE);
}
}
break;
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 54076a3..b8e6885 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -548,6 +548,7 @@
'browser/debugger/devtools_remote_message.h',
'browser/debugger/devtools_remote_service.cc',
'browser/debugger/devtools_remote_service.h',
+ 'browser/debugger/devtools_toggle_action.h',
'browser/debugger/devtools_window.cc',
'browser/debugger/devtools_window.h',
'browser/debugger/extension_ports_remote_service.cc',