| 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/extensions/extension_keybinding_registry_gtk.h" |
| 10 #include "chrome/browser/ui/gtk/gtk_util.h" | 10 #include "chrome/browser/ui/gtk/gtk_util.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 g_signal_connect(window_, "configure-event", | 107 g_signal_connect(window_, "configure-event", |
| 108 G_CALLBACK(OnConfigureThunk), this); | 108 G_CALLBACK(OnConfigureThunk), this); |
| 109 g_signal_connect(window_, "window-state-event", | 109 g_signal_connect(window_, "window-state-event", |
| 110 G_CALLBACK(OnWindowStateThunk), this); | 110 G_CALLBACK(OnWindowStateThunk), this); |
| 111 if (frameless_) { | 111 if (frameless_) { |
| 112 g_signal_connect(window_, "button-press-event", | 112 g_signal_connect(window_, "button-press-event", |
| 113 G_CALLBACK(OnButtonPressThunk), this); | 113 G_CALLBACK(OnButtonPressThunk), this); |
| 114 } | 114 } |
| 115 | 115 |
| 116 // Add the keybinding registry. | 116 // Add the keybinding registry. |
| 117 extension_keybinding_registry_.reset( | 117 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryGtk( |
| 118 new ExtensionKeybindingRegistryGtk(shell_window_->profile(), window_, | 118 shell_window_->profile(), |
| 119 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY)); | 119 window_, |
| 120 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, |
| 121 shell_window_)); |
| 120 | 122 |
| 121 ui::ActiveWindowWatcherX::AddObserver(this); | 123 ui::ActiveWindowWatcherX::AddObserver(this); |
| 122 } | 124 } |
| 123 | 125 |
| 124 ShellWindowGtk::~ShellWindowGtk() { | 126 ShellWindowGtk::~ShellWindowGtk() { |
| 125 ui::ActiveWindowWatcherX::RemoveObserver(this); | 127 ui::ActiveWindowWatcherX::RemoveObserver(this); |
| 126 } | 128 } |
| 127 | 129 |
| 128 bool ShellWindowGtk::IsActive() const { | 130 bool ShellWindowGtk::IsActive() const { |
| 129 return is_active_; | 131 return is_active_; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 } | 373 } |
| 372 | 374 |
| 373 draggable_region_ = draggable_region; | 375 draggable_region_ = draggable_region; |
| 374 } | 376 } |
| 375 | 377 |
| 376 // static | 378 // static |
| 377 NativeShellWindow* NativeShellWindow::Create( | 379 NativeShellWindow* NativeShellWindow::Create( |
| 378 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { | 380 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { |
| 379 return new ShellWindowGtk(shell_window, params); | 381 return new ShellWindowGtk(shell_window, params); |
| 380 } | 382 } |
| OLD | NEW |