diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-14 21:14:01 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-14 21:14:01 +0000 |
commit | f94f0f14dd3c9c49c6da8bdf3d7de19f4a6fb6b7 (patch) | |
tree | 17f77aa9323a3e1de24b6603e385301eab13d8c3 /ui/aura/window_delegate.h | |
parent | e49d616f0151b407d6b9296167facdc0655811c5 (diff) | |
download | chromium_src-f94f0f14dd3c9c49c6da8bdf3d7de19f4a6fb6b7.zip chromium_src-f94f0f14dd3c9c49c6da8bdf3d7de19f4a6fb6b7.tar.gz chromium_src-f94f0f14dd3c9c49c6da8bdf3d7de19f4a6fb6b7.tar.bz2 |
Move Aura to UI subdir.
BUG=none
TEST=none
TBR=sky
Review URL: http://codereview.chromium.org/7886042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101156 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/window_delegate.h')
-rw-r--r-- | ui/aura/window_delegate.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/ui/aura/window_delegate.h b/ui/aura/window_delegate.h new file mode 100644 index 0000000..b7b02e0 --- /dev/null +++ b/ui/aura/window_delegate.h @@ -0,0 +1,53 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_AURA_WINDOW_DELEGATE_H_ +#define UI_AURA_WINDOW_DELEGATE_H_ +#pragma once + +namespace gfx { +class Canvas; +class Point; +} + +namespace aura { + +class KeyEvent; +class MouseEvent; + +// Delegate interface for aura::Window. +class WindowDelegate { + public: + // Sent to the Window's delegate when the Window gains or loses focus. + virtual void OnFocus() = 0; + virtual void OnBlur() = 0; + + virtual bool OnKeyEvent(KeyEvent* event) = 0; + + // Returns the non-client component (see hit_test.h) containing |point|, in + // window coordinates. + virtual int GetNonClientComponent(const gfx::Point& point) const = 0; + + virtual bool OnMouseEvent(MouseEvent* event) = 0; + + // Asks the delegate to paint window contents into the supplied canvas. + virtual void OnPaint(gfx::Canvas* canvas) = 0; + + // Called from Window's destructor before OnWindowDestroyed and before the + // children have been destroyed. + virtual void OnWindowDestroying() = 0; + + // Called when the Window has been destroyed (i.e. from its destructor). This + // is called after OnWindowDestroying and after the children have been + // deleted. + // The delegate can use this as an opportunity to delete itself if necessary. + virtual void OnWindowDestroyed() = 0; + + protected: + virtual ~WindowDelegate() {} +}; + +} // namespace aura + +#endif // UI_AURA_WINDOW_DELEGATE_H_ |