summaryrefslogtreecommitdiffstats
path: root/ui/aura/test/test_window_delegate.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-10 20:26:47 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-10 20:26:47 +0000
commit6377a003e5948a14cf79bf6433e4c89dbc9354e0 (patch)
treeb84cc5488c90e4b3ef85bba3f61a7613a2d4579d /ui/aura/test/test_window_delegate.cc
parent90c5032fb8beef603812ac47769184ae526abaf8 (diff)
downloadchromium_src-6377a003e5948a14cf79bf6433e4c89dbc9354e0.zip
chromium_src-6377a003e5948a14cf79bf6433e4c89dbc9354e0.tar.gz
chromium_src-6377a003e5948a14cf79bf6433e4c89dbc9354e0.tar.bz2
Rid the world of TopLevelWindowContainer, and "toplevel" concept from Window entirely.
- Creates StackingController in aura_shell to manage stacking and implement aura::StackingClient. - Moves DesktopEventFilter to shell, since it's mostly shell-related anyway. - Move relevant tests to shell, requiring some refactoring to move test utils around. BUG=none TEST=none Review URL: http://codereview.chromium.org/8505049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109492 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/test/test_window_delegate.cc')
-rw-r--r--ui/aura/test/test_window_delegate.cc57
1 files changed, 57 insertions, 0 deletions
diff --git a/ui/aura/test/test_window_delegate.cc b/ui/aura/test/test_window_delegate.cc
index 8957eba..b179fda 100644
--- a/ui/aura/test/test_window_delegate.cc
+++ b/ui/aura/test/test_window_delegate.cc
@@ -4,11 +4,18 @@
#include "ui/aura/test/test_window_delegate.h"
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "ui/aura/event.h"
+#include "ui/aura/window.h"
#include "ui/base/hit_test.h"
+#include "ui/gfx/canvas.h"
namespace aura {
namespace test {
+////////////////////////////////////////////////////////////////////////////////
+// TestWindowDelegate
+
TestWindowDelegate::TestWindowDelegate() {
}
@@ -70,5 +77,55 @@ void TestWindowDelegate::OnWindowDestroyed() {
void TestWindowDelegate::OnWindowVisibilityChanged(bool visible) {
}
+
+////////////////////////////////////////////////////////////////////////////////
+// ColorTestWindowDelegate
+
+ColorTestWindowDelegate::ColorTestWindowDelegate(SkColor color)
+ : color_(color),
+ last_key_code_(ui::VKEY_UNKNOWN) {
+}
+ColorTestWindowDelegate::~ColorTestWindowDelegate() {
+}
+
+bool ColorTestWindowDelegate::OnKeyEvent(KeyEvent* event) {
+ last_key_code_ = event->key_code();
+ return true;
+}
+void ColorTestWindowDelegate::OnWindowDestroyed() {
+ delete this;
+}
+void ColorTestWindowDelegate::OnPaint(gfx::Canvas* canvas) {
+ canvas->GetSkCanvas()->drawColor(color_, SkXfermode::kSrc_Mode);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// ActivateWindowDelegate
+
+ActivateWindowDelegate::ActivateWindowDelegate()
+ : activate_(true),
+ activated_count_(0),
+ lost_active_count_(0),
+ should_activate_count_(0) {
+}
+
+ActivateWindowDelegate::ActivateWindowDelegate(bool activate)
+ : activate_(activate),
+ activated_count_(0),
+ lost_active_count_(0),
+ should_activate_count_(0) {
+}
+
+bool ActivateWindowDelegate::ShouldActivate(Event* event) {
+ should_activate_count_++;
+ return activate_;
+}
+void ActivateWindowDelegate::OnActivated() {
+ activated_count_++;
+}
+void ActivateWindowDelegate::OnLostActive() {
+ lost_active_count_++;
+}
+
} // namespace test
} // namespace aura