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

Side by Side Diff: ui/aura/client/activation_delegate.h

Issue 8956004: Move ActivationClient/Delegate to client namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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/aura/client/activation_client.cc ('k') | ui/aura/client/activation_delegate.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_AURA_CLIENT_ACTIVATION_DELEGATE_H_ 5 #ifndef UI_AURA_CLIENT_ACTIVATION_DELEGATE_H_
6 #define UI_AURA_CLIENT_ACTIVATION_DELEGATE_H_ 6 #define UI_AURA_CLIENT_ACTIVATION_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "ui/aura/aura_export.h" 9 #include "ui/aura/aura_export.h"
10 10
11 namespace aura { 11 namespace aura {
12
13 class Event; 12 class Event;
14 class Window; 13 class Window;
14 namespace client {
15 15
16 // An interface implemented by an object that configures and responds to changes 16 // An interface implemented by an object that configures and responds to changes
17 // to a window's activation state. 17 // to a window's activation state.
18 class AURA_EXPORT ActivationDelegate { 18 class AURA_EXPORT ActivationDelegate {
19 public: 19 public:
20 // Sets/Gets the ActivationDelegate on the Window. No ownership changes.
21 static void SetActivationDelegate(Window* window,
22 ActivationDelegate* delegate);
23 static ActivationDelegate* GetActivationDelegate(Window* window);
24
25 // Returns true if the window should be activated. |event| is either the mouse 20 // Returns true if the window should be activated. |event| is either the mouse
26 // event supplied if the activation is the result of a mouse, or the touch 21 // event supplied if the activation is the result of a mouse, or the touch
27 // event if the activation is the result of a touch, or NULL if activation is 22 // event if the activation is the result of a touch, or NULL if activation is
28 // attempted for another reason. 23 // attempted for another reason.
29 virtual bool ShouldActivate(Event* event) = 0; 24 virtual bool ShouldActivate(Event* event) = 0;
30 25
31 // Sent when the window is activated. 26 // Sent when the window is activated.
32 virtual void OnActivated() = 0; 27 virtual void OnActivated() = 0;
33 28
34 // Sent when the window loses active status. 29 // Sent when the window loses active status.
35 virtual void OnLostActive() = 0; 30 virtual void OnLostActive() = 0;
36 31
37 protected: 32 protected:
38 virtual ~ActivationDelegate() {} 33 virtual ~ActivationDelegate() {}
39 }; 34 };
40 35
36 // Sets/Gets the ActivationDelegate on the Window. No ownership changes.
37 AURA_EXPORT void SetActivationDelegate(Window* window,
38 ActivationDelegate* delegate);
39 AURA_EXPORT ActivationDelegate* GetActivationDelegate(Window* window);
40
41 } // namespace client
41 } // namespace aura 42 } // namespace aura
42 43
43 #endif // UI_AURA_CLIENT_ACTIVATION_DELEGATE_H_ 44 #endif // UI_AURA_CLIENT_ACTIVATION_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/aura/client/activation_client.cc ('k') | ui/aura/client/activation_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698