| 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/views/panels/panel_view.h" | 5 #include "chrome/browser/ui/views/panels/panel_view.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 } | 974 } |
| 975 | 975 |
| 976 void PanelView::OnWidgetActivationChanged(views::Widget* widget, bool active) { | 976 void PanelView::OnWidgetActivationChanged(views::Widget* widget, bool active) { |
| 977 #if defined(OS_WIN) | 977 #if defined(OS_WIN) |
| 978 // WM_NCACTIVATED could be sent when an active window is being destroyed on | 978 // WM_NCACTIVATED could be sent when an active window is being destroyed on |
| 979 // Windows. We need to guard against this. | 979 // Windows. We need to guard against this. |
| 980 if (window_closed_) | 980 if (window_closed_) |
| 981 return; | 981 return; |
| 982 | 982 |
| 983 bool focused = active; | 983 bool focused = active; |
| 984 if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_NATIVE) { | 984 if (chrome::GetActiveDesktop() == ui::HOST_DESKTOP_TYPE_NATIVE) { |
| 985 // The panel window is in focus (actually accepting keystrokes) if it is | 985 // The panel window is in focus (actually accepting keystrokes) if it is |
| 986 // active and belongs to a foreground application. | 986 // active and belongs to a foreground application. |
| 987 focused = active && | 987 focused = active && |
| 988 views::HWNDForWidget(widget) == ::GetForegroundWindow(); | 988 views::HWNDForWidget(widget) == ::GetForegroundWindow(); |
| 989 } | 989 } |
| 990 #else | 990 #else |
| 991 bool focused = active; | 991 bool focused = active; |
| 992 #endif | 992 #endif |
| 993 | 993 |
| 994 if (focused_ == focused) | 994 if (focused_ == focused) |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 // SWP_FRAMECHANGED flag must be called in order for the cached window data | 1138 // SWP_FRAMECHANGED flag must be called in order for the cached window data |
| 1139 // to be updated properly. | 1139 // to be updated properly. |
| 1140 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a
spx | 1140 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a
spx |
| 1141 if (update_frame) { | 1141 if (update_frame) { |
| 1142 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0, | 1142 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0, |
| 1143 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | | 1143 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | |
| 1144 SWP_NOZORDER | SWP_NOACTIVATE); | 1144 SWP_NOZORDER | SWP_NOACTIVATE); |
| 1145 } | 1145 } |
| 1146 } | 1146 } |
| 1147 #endif | 1147 #endif |
| OLD | NEW |