Index: content/shell/shell_gtk.cc |
diff --git a/content/shell/shell_gtk.cc b/content/shell/shell_gtk.cc |
index 7cb795129484774b2c9fb3057c7a6bba237462ab..0f9121bdf547bca3bfaa19d03cd46b2aa9186000 100644 |
--- a/content/shell/shell_gtk.cc |
+++ b/content/shell/shell_gtk.cc |
@@ -16,6 +16,8 @@ |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_contents_view.h" |
#include "content/public/common/renderer_preferences.h" |
+#include "content/shell/shell_browser_context.h" |
+#include "content/shell/shell_content_browser_client.h" |
#include "content/shell/shell_switches.h" |
#include "third_party/skia/include/core/SkColor.h" |
@@ -82,6 +84,12 @@ void Shell::PlatformCreateWindow(int width, int height) { |
g_cclosure_new(G_CALLBACK(OnCloseWindowKeyPressedThunk), |
this, NULL)); |
+ gtk_accel_group_connect( |
+ accel_group, GDK_n, GDK_CONTROL_MASK, |
+ GTK_ACCEL_VISIBLE, |
+ g_cclosure_new(G_CALLBACK(OnNewWindowKeyPressedThunk), |
+ this, NULL)); |
+ |
GtkWidget* toolbar = gtk_toolbar_new(); |
// Turn off the labels on the toolbar buttons. |
gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS); |
@@ -224,6 +232,21 @@ gboolean Shell::OnCloseWindowKeyPressed(GtkAccelGroup* accel_group, |
return TRUE; |
} |
+gboolean Shell::OnNewWindowKeyPressed(GtkAccelGroup* accel_group, |
+ GObject* acceleratable, |
+ guint keyval, |
+ GdkModifierType modifier) { |
+ ShellBrowserContext* browser_context = |
+ static_cast<ShellContentBrowserClient*>( |
+ GetContentClient()->browser())->browser_context(); |
+ Shell::CreateNewWindow(browser_context, |
+ GURL(), |
+ NULL, |
+ MSG_ROUTING_NONE, |
+ NULL); |
+ return TRUE; |
+} |
+ |
gboolean Shell::OnHighlightURLView(GtkAccelGroup* accel_group, |
GObject* acceleratable, |
guint keyval, |