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

Side by Side Diff: ui/wm/public/activation_change_observer.h

Issue 1153633006: Added UMA statistics for changing the active window via click or touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reworked approach to use the an ActivationChangeObserver. 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/wm/core/shadow_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 #ifndef UI_WM_PUBLIC_ACTIVATION_CHANGE_OBSERVER_H_ 5 #ifndef UI_WM_PUBLIC_ACTIVATION_CHANGE_OBSERVER_H_
6 #define UI_WM_PUBLIC_ACTIVATION_CHANGE_OBSERVER_H_ 6 #define UI_WM_PUBLIC_ACTIVATION_CHANGE_OBSERVER_H_
7 7
8 #include "ui/aura/aura_export.h" 8 #include "ui/aura/aura_export.h"
9 9
10 namespace aura { 10 namespace aura {
11 class Window; 11 class Window;
12 12
13 namespace client { 13 namespace client {
14 14
15 class AURA_EXPORT ActivationChangeObserver { 15 class AURA_EXPORT ActivationChangeObserver {
16 public: 16 public:
17 // The reason or cause of a window activation change.
18 enum class ActivationReason {
19 // When a window is activated due to a call to the ActivationClient API.
20 kActivationClient,
sky 2015/06/02 15:43:03 In chrome we don't use this style for enums, we us
bruthig 2015/06/03 21:59:31 Done.
21 // When a user clicks or taps a window in the 2-dimensional screen space.
22 kInputEvent,
23 // When a new window is activated as a side effect of a window
24 // disposition changing.
25 kWindowDispositionChanged,
26 };
27
17 // Called when |active| gains focus, or there is no active window 28 // Called when |active| gains focus, or there is no active window
18 // (|active| is NULL in this case.) |old_active| refers to the 29 // (|active| is NULL in this case.) |old_active| refers to the
19 // previous active window or NULL if there was no previously active 30 // previous active window or NULL if there was no previously active
20 // window. 31 // window. |reason| specifies the cause of the activation change.
21 virtual void OnWindowActivated(Window* gained_active, 32 virtual void OnWindowActivated(ActivationReason reason,
33 Window* gained_active,
22 Window* lost_active) = 0; 34 Window* lost_active) = 0;
23 35
24 // Called when during window activation the currently active window is 36 // Called when during window activation the currently active window is
25 // selected for activation. This can happen when a window requested for 37 // selected for activation. This can happen when a window requested for
26 // activation cannot be activated because a system modal window is active. 38 // activation cannot be activated because a system modal window is active.
27 virtual void OnAttemptToReactivateWindow(aura::Window* request_active, 39 virtual void OnAttemptToReactivateWindow(aura::Window* request_active,
28 aura::Window* actual_active) {} 40 aura::Window* actual_active) {}
29 41
30 protected: 42 protected:
31 virtual ~ActivationChangeObserver() {} 43 virtual ~ActivationChangeObserver() {}
32 }; 44 };
33 45
34 // Gets/Sets the ActivationChangeObserver for a specific window. This observer 46 // Gets/Sets the ActivationChangeObserver for a specific window. This observer
35 // is notified after the ActivationClient notifies all registered observers. 47 // is notified after the ActivationClient notifies all registered observers.
36 AURA_EXPORT void SetActivationChangeObserver( 48 AURA_EXPORT void SetActivationChangeObserver(
37 Window* window, 49 Window* window,
38 ActivationChangeObserver* observer); 50 ActivationChangeObserver* observer);
39 AURA_EXPORT ActivationChangeObserver* GetActivationChangeObserver( 51 AURA_EXPORT ActivationChangeObserver* GetActivationChangeObserver(
40 Window* window); 52 Window* window);
41 53
42 } // namespace client 54 } // namespace client
43 } // namespace aura 55 } // namespace aura
44 56
45 #endif // UI_WM_PUBLIC_ACTIVATION_CHANGE_OBSERVER_H_ 57 #endif // UI_WM_PUBLIC_ACTIVATION_CHANGE_OBSERVER_H_
OLDNEW
« no previous file with comments | « ui/wm/core/shadow_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698