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

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

Issue 10703145: Merge 144625 - Close any open menus on activation changes. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/menu/menu_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "ui/base/hit_test.h" 10 #include "ui/base/hit_test.h"
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 917
918 bool Widget::IsInactiveRenderingDisabled() const { 918 bool Widget::IsInactiveRenderingDisabled() const {
919 return disable_inactive_rendering_; 919 return disable_inactive_rendering_;
920 } 920 }
921 921
922 void Widget::EnableInactiveRendering() { 922 void Widget::EnableInactiveRendering() {
923 SetInactiveRenderingDisabled(false); 923 SetInactiveRenderingDisabled(false);
924 } 924 }
925 925
926 void Widget::OnNativeWidgetActivationChanged(bool active) { 926 void Widget::OnNativeWidgetActivationChanged(bool active) {
927 if (!active) { 927 if (!active)
928 SaveWindowPlacement(); 928 SaveWindowPlacement();
929 929
930 #if defined(OS_CHROMEOS)
931 // Close any open menus.
932 // TODO(flackr|oshima): We should be doing this on !OS_MACOSX as before but
933 // we will have to fix crbug.com/130799.
934 MenuController* menu_controller = MenuController::GetActiveInstance();
935 if (menu_controller)
936 menu_controller->OnWidgetActivationChanged();
937 #endif // defined(OS_CHROMEOS)
938 }
939
940 FOR_EACH_OBSERVER(Observer, observers_, 930 FOR_EACH_OBSERVER(Observer, observers_,
941 OnWidgetActivationChanged(this, active)); 931 OnWidgetActivationChanged(this, active));
942 } 932 }
943 933
944 void Widget::OnNativeFocus(gfx::NativeView old_focused_view) { 934 void Widget::OnNativeFocus(gfx::NativeView old_focused_view) {
945 WidgetFocusManager::GetInstance()->OnWidgetFocusEvent(old_focused_view, 935 WidgetFocusManager::GetInstance()->OnWidgetFocusEvent(old_focused_view,
946 GetNativeView()); 936 GetNativeView());
947 } 937 }
948 938
949 void Widget::OnNativeBlur(gfx::NativeView new_focused_view) { 939 void Widget::OnNativeBlur(gfx::NativeView new_focused_view) {
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 1325
1336 //////////////////////////////////////////////////////////////////////////////// 1326 ////////////////////////////////////////////////////////////////////////////////
1337 // internal::NativeWidgetPrivate, NativeWidget implementation: 1327 // internal::NativeWidgetPrivate, NativeWidget implementation:
1338 1328
1339 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1329 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1340 return this; 1330 return this;
1341 } 1331 }
1342 1332
1343 } // namespace internal 1333 } // namespace internal
1344 } // namespace views 1334 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698