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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_popup_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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/extensions/extension_popup_aura.h" 5 #include "chrome/browser/ui/views/extensions/extension_popup_aura.h"
6 6
7 #include "ui/aura/window.h" 7 #include "ui/aura/window.h"
8 #include "ui/views/widget/widget.h" 8 #include "ui/views/widget/widget.h"
9 #include "ui/wm/core/window_animations.h" 9 #include "ui/wm/core/window_animations.h"
10 #include "ui/wm/core/window_util.h" 10 #include "ui/wm/core/window_util.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 auto activation_client = aura::client::GetActivationClient( 46 auto activation_client = aura::client::GetActivationClient(
47 widget->GetNativeWindow()->GetRootWindow()); 47 widget->GetNativeWindow()->GetRootWindow());
48 // If the popup was being inspected with devtools and the browser window 48 // If the popup was being inspected with devtools and the browser window
49 // was closed, then the root window and activation client are already 49 // was closed, then the root window and activation client are already
50 // destroyed. 50 // destroyed.
51 if (activation_client) 51 if (activation_client)
52 activation_client->RemoveObserver(this); 52 activation_client->RemoveObserver(this);
53 } 53 }
54 } 54 }
55 55
56 void ExtensionPopupAura::OnWindowActivated(aura::Window* gained_active, 56 void ExtensionPopupAura::OnWindowActivated(
57 aura::Window* lost_active) { 57 aura::client::ActivationChangeObserver::ActivationReason reason,
58 aura::Window* gained_active,
59 aura::Window* lost_active) {
58 // Close on anchor window activation (ie. user clicked the browser window). 60 // Close on anchor window activation (ie. user clicked the browser window).
59 // DesktopNativeWidgetAura does not trigger the expected browser widget 61 // DesktopNativeWidgetAura does not trigger the expected browser widget
60 // [de]activation events when activating widgets in its own root window. 62 // [de]activation events when activating widgets in its own root window.
61 // This additional check handles those cases. See: http://crbug.com/320889 63 // This additional check handles those cases. See: http://crbug.com/320889
62 if (gained_active == anchor_widget()->GetNativeWindow()) 64 if (gained_active == anchor_widget()->GetNativeWindow())
63 OnAnchorWindowActivation(); 65 OnAnchorWindowActivation();
64 } 66 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_popup_aura.h ('k') | ui/views/controls/menu/menu_message_loop_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698