OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/gtk/browser_window_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 // Do nothing if we're in the process of closing the browser window. | 1197 // Do nothing if we're in the process of closing the browser window. |
1198 if (!window_) | 1198 if (!window_) |
1199 return; | 1199 return; |
1200 | 1200 |
1201 bool is_active = (GTK_WIDGET(window_)->window == active_window); | 1201 bool is_active = (GTK_WIDGET(window_)->window == active_window); |
1202 bool changed = (is_active != is_active_); | 1202 bool changed = (is_active != is_active_); |
1203 | 1203 |
1204 if (is_active && changed) { | 1204 if (is_active && changed) { |
1205 // If there's an app modal dialog (e.g., JS alert), try to redirect | 1205 // If there's an app modal dialog (e.g., JS alert), try to redirect |
1206 // the user's attention to the window owning the dialog. | 1206 // the user's attention to the window owning the dialog. |
1207 if (Singleton<AppModalDialogQueue>()->HasActiveDialog()) { | 1207 if (AppModalDialogQueue::GetInstance()->HasActiveDialog()) { |
1208 Singleton<AppModalDialogQueue>()->ActivateModalDialog(); | 1208 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
1209 return; | 1209 return; |
1210 } | 1210 } |
1211 } | 1211 } |
1212 | 1212 |
1213 is_active_ = is_active; | 1213 is_active_ = is_active; |
1214 if (changed) { | 1214 if (changed) { |
1215 SetBackgroundColor(); | 1215 SetBackgroundColor(); |
1216 gdk_window_invalidate_rect(GTK_WIDGET(window_)->window, | 1216 gdk_window_invalidate_rect(GTK_WIDGET(window_)->window, |
1217 >K_WIDGET(window_)->allocation, TRUE); | 1217 >K_WIDGET(window_)->allocation, TRUE); |
1218 // For some reason, the above two calls cause the window shape to be | 1218 // For some reason, the above two calls cause the window shape to be |
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2234 // special-case the ones where the custom frame should be used. These names | 2234 // special-case the ones where the custom frame should be used. These names |
2235 // are taken from the WMs' source code. | 2235 // are taken from the WMs' source code. |
2236 return (wm_name == "Blackbox" || | 2236 return (wm_name == "Blackbox" || |
2237 wm_name == "compiz" || | 2237 wm_name == "compiz" || |
2238 wm_name == "e16" || // Enlightenment DR16 | 2238 wm_name == "e16" || // Enlightenment DR16 |
2239 wm_name == "Metacity" || | 2239 wm_name == "Metacity" || |
2240 wm_name == "Mutter" || | 2240 wm_name == "Mutter" || |
2241 wm_name == "Openbox" || | 2241 wm_name == "Openbox" || |
2242 wm_name == "Xfwm4"); | 2242 wm_name == "Xfwm4"); |
2243 } | 2243 } |
OLD | NEW |