OLD | NEW |
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 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/aura/desktop.h" | 9 #include "ui/aura/desktop.h" |
10 #include "ui/aura/event.h" | 10 #include "ui/aura/event.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 // Overridden from WindowDelegateImpl: | 156 // Overridden from WindowDelegateImpl: |
157 virtual bool OnKeyEvent(KeyEvent* event) OVERRIDE { | 157 virtual bool OnKeyEvent(KeyEvent* event) OVERRIDE { |
158 last_key_code_ = event->key_code(); | 158 last_key_code_ = event->key_code(); |
159 return true; | 159 return true; |
160 } | 160 } |
161 virtual void OnWindowDestroyed() OVERRIDE { | 161 virtual void OnWindowDestroyed() OVERRIDE { |
162 delete this; | 162 delete this; |
163 } | 163 } |
164 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 164 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
165 canvas->AsCanvasSkia()->drawColor(color_, SkXfermode::kSrc_Mode); | 165 canvas->GetSkCanvas()->drawColor(color_, SkXfermode::kSrc_Mode); |
166 } | 166 } |
167 | 167 |
168 private: | 168 private: |
169 SkColor color_; | 169 SkColor color_; |
170 ui::KeyboardCode last_key_code_; | 170 ui::KeyboardCode last_key_code_; |
171 | 171 |
172 DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate); | 172 DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate); |
173 }; | 173 }; |
174 | 174 |
175 class WindowTest : public testing::Test { | 175 class WindowTest : public testing::Test { |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 EXPECT_EQ(w11.get(), w1->GetEventHandlerForPoint(gfx::Point(10, 10))); | 615 EXPECT_EQ(w11.get(), w1->GetEventHandlerForPoint(gfx::Point(10, 10))); |
616 | 616 |
617 w12->AddChild(w121.get()); | 617 w12->AddChild(w121.get()); |
618 | 618 |
619 EXPECT_EQ(NULL, w1->GetEventHandlerForPoint(gfx::Point(10, 10))); | 619 EXPECT_EQ(NULL, w1->GetEventHandlerForPoint(gfx::Point(10, 10))); |
620 EXPECT_EQ(w121.get(), w1->GetEventHandlerForPoint(gfx::Point(175, 175))); | 620 EXPECT_EQ(w121.get(), w1->GetEventHandlerForPoint(gfx::Point(175, 175))); |
621 } | 621 } |
622 | 622 |
623 } // namespace internal | 623 } // namespace internal |
624 } // namespace aura | 624 } // namespace aura |
OLD | NEW |