Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: ui/views/widget/widget.cc

Issue 1733293002: Toggle avatar color when window activation changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Convert widget observer to direct call Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ui/views/widget/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.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 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 void Widget::OnNativeWidgetActivationChanged(bool active) { 1029 void Widget::OnNativeWidgetActivationChanged(bool active) {
1030 // On windows we may end up here before we've completed initialization (from 1030 // On windows we may end up here before we've completed initialization (from
1031 // an WM_NCACTIVATE). If that happens the WidgetDelegate likely doesn't know 1031 // an WM_NCACTIVATE). If that happens the WidgetDelegate likely doesn't know
1032 // the Widget and will crash attempting to access it. 1032 // the Widget and will crash attempting to access it.
1033 if (!active && native_widget_initialized_) 1033 if (!active && native_widget_initialized_)
1034 SaveWindowPlacement(); 1034 SaveWindowPlacement();
1035 1035
1036 FOR_EACH_OBSERVER(WidgetObserver, observers_, 1036 FOR_EACH_OBSERVER(WidgetObserver, observers_,
1037 OnWidgetActivationChanged(this, active)); 1037 OnWidgetActivationChanged(this, active));
1038 1038
1039 if (IsVisible() && non_client_view()) 1039 if (non_client_view()) {
1040 non_client_view()->frame_view()->SchedulePaint(); 1040 non_client_view()->frame_view()->ActivationChanged(active);
1041 if (IsVisible())
1042 non_client_view()->frame_view()->SchedulePaint();
1043 }
1041 } 1044 }
1042 1045
1043 void Widget::OnNativeFocus() { 1046 void Widget::OnNativeFocus() {
1044 WidgetFocusManager::GetInstance()->OnNativeFocusChanged(GetNativeView()); 1047 WidgetFocusManager::GetInstance()->OnNativeFocusChanged(GetNativeView());
1045 } 1048 }
1046 1049
1047 void Widget::OnNativeBlur() { 1050 void Widget::OnNativeBlur() {
1048 WidgetFocusManager::GetInstance()->OnNativeFocusChanged(nullptr); 1051 WidgetFocusManager::GetInstance()->OnNativeFocusChanged(nullptr);
1049 } 1052 }
1050 1053
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 1491
1489 //////////////////////////////////////////////////////////////////////////////// 1492 ////////////////////////////////////////////////////////////////////////////////
1490 // internal::NativeWidgetPrivate, NativeWidget implementation: 1493 // internal::NativeWidgetPrivate, NativeWidget implementation:
1491 1494
1492 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1495 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1493 return this; 1496 return this;
1494 } 1497 }
1495 1498
1496 } // namespace internal 1499 } // namespace internal
1497 } // namespace views 1500 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_non_client_frame_view.cc ('k') | ui/views/window/non_client_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698