OLD | NEW |
---|---|
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/gtk/extensions/shell_window_gtk.h" | 5 #include "chrome/browser/ui/gtk/extensions/shell_window_gtk.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.h" | |
8 #include "chrome/browser/ui/gtk/gtk_window_util.h" | 9 #include "chrome/browser/ui/gtk/gtk_window_util.h" |
9 #include "chrome/browser/web_applications/web_app.h" | 10 #include "chrome/browser/web_applications/web_app.h" |
10 #include "chrome/common/extensions/draggable_region.h" | 11 #include "chrome/common/extensions/draggable_region.h" |
11 #include "chrome/common/extensions/extension.h" | 12 #include "chrome/common/extensions/extension.h" |
12 #include "content/public/browser/render_view_host.h" | 13 #include "content/public/browser/render_view_host.h" |
13 #include "content/public/browser/render_widget_host_view.h" | 14 #include "content/public/browser/render_widget_host_view.h" |
14 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
15 #include "content/public/browser/web_contents_view.h" | 16 #include "content/public/browser/web_contents_view.h" |
16 #include "ui/base/x/active_window_watcher_x.h" | 17 #include "ui/base/x/active_window_watcher_x.h" |
17 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 G_CALLBACK(OnMainWindowDeleteEventThunk), this); | 86 G_CALLBACK(OnMainWindowDeleteEventThunk), this); |
86 g_signal_connect(window_, "configure-event", | 87 g_signal_connect(window_, "configure-event", |
87 G_CALLBACK(OnConfigureThunk), this); | 88 G_CALLBACK(OnConfigureThunk), this); |
88 g_signal_connect(window_, "window-state-event", | 89 g_signal_connect(window_, "window-state-event", |
89 G_CALLBACK(OnWindowStateThunk), this); | 90 G_CALLBACK(OnWindowStateThunk), this); |
90 if (frameless_) { | 91 if (frameless_) { |
91 g_signal_connect(window_, "button-press-event", | 92 g_signal_connect(window_, "button-press-event", |
92 G_CALLBACK(OnButtonPressThunk), this); | 93 G_CALLBACK(OnButtonPressThunk), this); |
93 } | 94 } |
94 | 95 |
96 // Add the keybinding registry, now that the window has been realized. | |
Evan Stade
2012/09/05 21:38:27
are you sure the window has been realized? Note th
Marijn Kruisselbrink
2012/09/06 18:09:57
Ah yes, I'm not sure actually if ExtensionKeybindi
| |
97 extension_keybinding_registry_.reset( | |
98 new ExtensionKeybindingRegistryGtk(shell_window_->profile(), window_, | |
99 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY)); | |
100 | |
95 ui::ActiveWindowWatcherX::AddObserver(this); | 101 ui::ActiveWindowWatcherX::AddObserver(this); |
96 } | 102 } |
97 | 103 |
98 ShellWindowGtk::~ShellWindowGtk() { | 104 ShellWindowGtk::~ShellWindowGtk() { |
99 ui::ActiveWindowWatcherX::RemoveObserver(this); | 105 ui::ActiveWindowWatcherX::RemoveObserver(this); |
100 } | 106 } |
101 | 107 |
102 bool ShellWindowGtk::IsActive() const { | 108 bool ShellWindowGtk::IsActive() const { |
103 return is_active_; | 109 return is_active_; |
104 } | 110 } |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 } | 315 } |
310 | 316 |
311 draggable_region_ = draggable_region; | 317 draggable_region_ = draggable_region; |
312 } | 318 } |
313 | 319 |
314 // static | 320 // static |
315 NativeShellWindow* NativeShellWindow::Create( | 321 NativeShellWindow* NativeShellWindow::Create( |
316 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { | 322 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { |
317 return new ShellWindowGtk(shell_window, params); | 323 return new ShellWindowGtk(shell_window, params); |
318 } | 324 } |
OLD | NEW |