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

Side by Side Diff: ui/aura/window_delegate.h

Issue 8770011: aura: Ask the WindowDelegate before a Window is Focus()ed. (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/window.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) 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_WINDOW_DELEGATE_H_ 5 #ifndef UI_AURA_WINDOW_DELEGATE_H_
6 #define UI_AURA_WINDOW_DELEGATE_H_ 6 #define UI_AURA_WINDOW_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 #include "ui/base/events.h" 10 #include "ui/base/events.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 virtual bool OnMouseEvent(MouseEvent* event) = 0; 51 virtual bool OnMouseEvent(MouseEvent* event) = 0;
52 52
53 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) = 0; 53 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) = 0;
54 54
55 // Returns true if the window should be activated. |event| is either the mouse 55 // Returns true if the window should be activated. |event| is either the mouse
56 // event supplied if the activation is the result of a mouse, or the touch 56 // event supplied if the activation is the result of a mouse, or the touch
57 // event if the activation is the result of a touch, or NULL if activation is 57 // event if the activation is the result of a touch, or NULL if activation is
58 // attempted for another reason. 58 // attempted for another reason.
59 virtual bool ShouldActivate(Event* event) = 0; 59 virtual bool ShouldActivate(Event* event) = 0;
60 60
61 // Returns true of the window can be focused.
62 virtual bool CanFocus() { return true; }
sadrul 2011/12/01 21:48:03 This probably should be pure virtual?
Ben Goodger (Google) 2011/12/01 22:16:31 Yes it should. In general, when you are adding the
sadrul 2011/12/01 22:18:23 Yes :) I wanted to confirm the approach looks sane
sadrul 2011/12/02 02:25:55 Done.
63
61 // Sent when the window is activated. 64 // Sent when the window is activated.
62 virtual void OnActivated() = 0; 65 virtual void OnActivated() = 0;
63 66
64 // Sent when the window loses active status. 67 // Sent when the window loses active status.
65 virtual void OnLostActive() = 0; 68 virtual void OnLostActive() = 0;
66 69
67 // Invoked when mouse capture is lost on the window. 70 // Invoked when mouse capture is lost on the window.
68 virtual void OnCaptureLost() = 0; 71 virtual void OnCaptureLost() = 0;
69 72
70 // Asks the delegate to paint window contents into the supplied canvas. 73 // Asks the delegate to paint window contents into the supplied canvas.
(...skipping 12 matching lines...) Expand all
83 // Called when the visibility of a Window changed. 86 // Called when the visibility of a Window changed.
84 virtual void OnWindowVisibilityChanged(bool visible) = 0; 87 virtual void OnWindowVisibilityChanged(bool visible) = 0;
85 88
86 protected: 89 protected:
87 virtual ~WindowDelegate() {} 90 virtual ~WindowDelegate() {}
88 }; 91 };
89 92
90 } // namespace aura 93 } // namespace aura
91 94
92 #endif // UI_AURA_WINDOW_DELEGATE_H_ 95 #endif // UI_AURA_WINDOW_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/aura/window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698