| 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 "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.h" |
| 9 #include "chrome/browser/ui/gtk/gtk_util.h" | 10 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 10 #include "chrome/browser/ui/gtk/gtk_window_util.h" | 11 #include "chrome/browser/ui/gtk/gtk_window_util.h" |
| 11 #include "chrome/browser/web_applications/web_app.h" | 12 #include "chrome/browser/web_applications/web_app.h" |
| 12 #include "chrome/common/extensions/draggable_region.h" | 13 #include "chrome/common/extensions/draggable_region.h" |
| 13 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
| 14 #include "content/public/browser/render_view_host.h" | 15 #include "content/public/browser/render_view_host.h" |
| 15 #include "content/public/browser/render_widget_host_view.h" | 16 #include "content/public/browser/render_widget_host_view.h" |
| 16 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 17 #include "content/public/browser/web_contents_view.h" | 18 #include "content/public/browser/web_contents_view.h" |
| 18 #include "ui/base/x/active_window_watcher_x.h" | 19 #include "ui/base/x/active_window_watcher_x.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 G_CALLBACK(OnMainWindowDeleteEventThunk), this); | 106 G_CALLBACK(OnMainWindowDeleteEventThunk), this); |
| 106 g_signal_connect(window_, "configure-event", | 107 g_signal_connect(window_, "configure-event", |
| 107 G_CALLBACK(OnConfigureThunk), this); | 108 G_CALLBACK(OnConfigureThunk), this); |
| 108 g_signal_connect(window_, "window-state-event", | 109 g_signal_connect(window_, "window-state-event", |
| 109 G_CALLBACK(OnWindowStateThunk), this); | 110 G_CALLBACK(OnWindowStateThunk), this); |
| 110 if (frameless_) { | 111 if (frameless_) { |
| 111 g_signal_connect(window_, "button-press-event", | 112 g_signal_connect(window_, "button-press-event", |
| 112 G_CALLBACK(OnButtonPressThunk), this); | 113 G_CALLBACK(OnButtonPressThunk), this); |
| 113 } | 114 } |
| 114 | 115 |
| 116 // Add the keybinding registry. |
| 117 extension_keybinding_registry_.reset( |
| 118 new ExtensionKeybindingRegistryGtk(shell_window_->profile(), window_, |
| 119 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY)); |
| 120 |
| 115 ui::ActiveWindowWatcherX::AddObserver(this); | 121 ui::ActiveWindowWatcherX::AddObserver(this); |
| 116 } | 122 } |
| 117 | 123 |
| 118 ShellWindowGtk::~ShellWindowGtk() { | 124 ShellWindowGtk::~ShellWindowGtk() { |
| 119 ui::ActiveWindowWatcherX::RemoveObserver(this); | 125 ui::ActiveWindowWatcherX::RemoveObserver(this); |
| 120 } | 126 } |
| 121 | 127 |
| 122 bool ShellWindowGtk::IsActive() const { | 128 bool ShellWindowGtk::IsActive() const { |
| 123 return is_active_; | 129 return is_active_; |
| 124 } | 130 } |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 } | 371 } |
| 366 | 372 |
| 367 draggable_region_ = draggable_region; | 373 draggable_region_ = draggable_region; |
| 368 } | 374 } |
| 369 | 375 |
| 370 // static | 376 // static |
| 371 NativeShellWindow* NativeShellWindow::Create( | 377 NativeShellWindow* NativeShellWindow::Create( |
| 372 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { | 378 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { |
| 373 return new ShellWindowGtk(shell_window, params); | 379 return new ShellWindowGtk(shell_window, params); |
| 374 } | 380 } |
| OLD | NEW |