Chromium Code Reviews| Index: content/shell/shell_gtk.cc |
| diff --git a/content/shell/shell_gtk.cc b/content/shell/shell_gtk.cc |
| index 7cb795129484774b2c9fb3057c7a6bba237462ab..c1d238d5dd879e3ddd8c9b7b3ec91817fd3302d0 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* browserContext = |
|
jochen (gone - plz use gerrit)
2012/08/09 08:34:25
browser_context
Shouqun Liu
2012/08/09 08:39:50
Done.
|
| + static_cast<ShellContentBrowserClient*>( |
| + GetContentClient()->browser())->browser_context(); |
| + Shell::CreateNewWindow(browserContext, |
| + GURL(), |
| + NULL, |
| + MSG_ROUTING_NONE, |
| + NULL); |
| + return TRUE; |
| +} |
| + |
| gboolean Shell::OnHighlightURLView(GtkAccelGroup* accel_group, |
| GObject* acceleratable, |
| guint keyval, |