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

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

Issue 1151133003: Added an ActivationReason parameter to ActivationChangeObserver::OnWindowActivated(...). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Uploaded diff based on dependant CL. Created 5 years, 6 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
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/wm/core/default_activation_client.h » ('j') | 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/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "third_party/skia/include/core/SkRegion.h" 9 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/aura/client/aura_constants.h" 10 #include "ui/aura/client/aura_constants.h"
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 //////////////////////////////////////////////////////////////////////////////// 929 ////////////////////////////////////////////////////////////////////////////////
930 // NativeWidgetAura, aura::client::ActivationDelegate implementation: 930 // NativeWidgetAura, aura::client::ActivationDelegate implementation:
931 931
932 bool NativeWidgetAura::ShouldActivate() const { 932 bool NativeWidgetAura::ShouldActivate() const {
933 return delegate_->CanActivate(); 933 return delegate_->CanActivate();
934 } 934 }
935 935
936 //////////////////////////////////////////////////////////////////////////////// 936 ////////////////////////////////////////////////////////////////////////////////
937 // NativeWidgetAura, aura::client::ActivationChangeObserver implementation: 937 // NativeWidgetAura, aura::client::ActivationChangeObserver implementation:
938 938
939 void NativeWidgetAura::OnWindowActivated(aura::Window* gained_active, 939 void NativeWidgetAura::OnWindowActivated(
940 aura::Window* lost_active) { 940 aura::client::ActivationChangeObserver::ActivationReason,
941 aura::Window* gained_active,
942 aura::Window* lost_active) {
941 DCHECK(window_ == gained_active || window_ == lost_active); 943 DCHECK(window_ == gained_active || window_ == lost_active);
942 if (GetWidget()->GetFocusManager()) { 944 if (GetWidget()->GetFocusManager()) {
943 if (window_ == gained_active) 945 if (window_ == gained_active)
944 GetWidget()->GetFocusManager()->RestoreFocusedView(); 946 GetWidget()->GetFocusManager()->RestoreFocusedView();
945 else if (window_ == lost_active) 947 else if (window_ == lost_active)
946 GetWidget()->GetFocusManager()->StoreFocusedView(true); 948 GetWidget()->GetFocusManager()->StoreFocusedView(true);
947 } 949 }
948 delegate_->OnNativeWidgetActivationChanged(window_ == gained_active); 950 delegate_->OnNativeWidgetActivationChanged(window_ == gained_active);
949 } 951 }
950 952
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); 1207 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont));
1206 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); 1208 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont)));
1207 return gfx::FontList(gfx::Font(caption_font)); 1209 return gfx::FontList(gfx::Font(caption_font));
1208 #else 1210 #else
1209 return gfx::FontList(); 1211 return gfx::FontList();
1210 #endif 1212 #endif
1211 } 1213 }
1212 1214
1213 } // namespace internal 1215 } // namespace internal
1214 } // namespace views 1216 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/wm/core/default_activation_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698