| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include <X11/XF86keysym.h> | 8 #include <X11/XF86keysym.h> |
| 9 | 9 |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 std::wstring* pref_name = Details<std::wstring>(details).ptr(); | 802 std::wstring* pref_name = Details<std::wstring>(details).ptr(); |
| 803 if (*pref_name == prefs::kUseCustomChromeFrame) { | 803 if (*pref_name == prefs::kUseCustomChromeFrame) { |
| 804 UpdateCustomFrame(); | 804 UpdateCustomFrame(); |
| 805 } else { | 805 } else { |
| 806 NOTREACHED() << "Got pref change notification we didn't register for!"; | 806 NOTREACHED() << "Got pref change notification we didn't register for!"; |
| 807 } | 807 } |
| 808 break; | 808 break; |
| 809 } | 809 } |
| 810 | 810 |
| 811 case NotificationType::ACTIVE_WINDOW_CHANGED: { | 811 case NotificationType::ACTIVE_WINDOW_CHANGED: { |
| 812 // Do nothing if we're in the process of closing the browser window. |
| 813 if (!window_) |
| 814 break; |
| 815 |
| 812 const GdkWindow* active_window = Details<const GdkWindow>(details).ptr(); | 816 const GdkWindow* active_window = Details<const GdkWindow>(details).ptr(); |
| 813 bool is_active = (GTK_WIDGET(window_)->window == active_window); | 817 bool is_active = (GTK_WIDGET(window_)->window == active_window); |
| 814 bool changed = (is_active != is_active_); | 818 bool changed = (is_active != is_active_); |
| 815 is_active_ = is_active; | 819 is_active_ = is_active; |
| 816 if (changed) { | 820 if (changed) { |
| 817 SetBackgroundColor(); | 821 SetBackgroundColor(); |
| 818 gdk_window_invalidate_rect(GTK_WIDGET(window_)->window, | 822 gdk_window_invalidate_rect(GTK_WIDGET(window_)->window, |
| 819 >K_WIDGET(window_)->allocation, TRUE); | 823 >K_WIDGET(window_)->allocation, TRUE); |
| 820 // For some reason, the above two calls cause the window shape to be | 824 // For some reason, the above two calls cause the window shape to be |
| 821 // lost so reset it. | 825 // lost so reset it. |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1444 *edge = GDK_WINDOW_EDGE_NORTH_EAST; | 1448 *edge = GDK_WINDOW_EDGE_NORTH_EAST; |
| 1445 } else if (y < bounds_.height() - kResizeAreaCornerSize) { | 1449 } else if (y < bounds_.height() - kResizeAreaCornerSize) { |
| 1446 *edge = GDK_WINDOW_EDGE_EAST; | 1450 *edge = GDK_WINDOW_EDGE_EAST; |
| 1447 } else { | 1451 } else { |
| 1448 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; | 1452 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; |
| 1449 } | 1453 } |
| 1450 return true; | 1454 return true; |
| 1451 } | 1455 } |
| 1452 NOTREACHED(); | 1456 NOTREACHED(); |
| 1453 } | 1457 } |
| OLD | NEW |