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

Side by Side Diff: ui/aura/test/test_window_delegate.cc

Issue 8894018: Move the concept of Activation to the Shell. (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/test/test_window_delegate.h ('k') | ui/aura/window.h » ('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 #include "ui/aura/test/test_window_delegate.h" 5 #include "ui/aura/test/test_window_delegate.h"
6 6
7 #include "third_party/skia/include/core/SkCanvas.h" 7 #include "third_party/skia/include/core/SkCanvas.h"
8 #include "ui/aura/event.h" 8 #include "ui/aura/event.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/base/hit_test.h" 10 #include "ui/base/hit_test.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 ui::TouchStatus TestWindowDelegate::OnTouchEvent(TouchEvent* event) { 55 ui::TouchStatus TestWindowDelegate::OnTouchEvent(TouchEvent* event) {
56 return ui::TOUCH_STATUS_UNKNOWN; 56 return ui::TOUCH_STATUS_UNKNOWN;
57 } 57 }
58 58
59 bool TestWindowDelegate::CanFocus() { 59 bool TestWindowDelegate::CanFocus() {
60 return true; 60 return true;
61 } 61 }
62 62
63 bool TestWindowDelegate::ShouldActivate(Event* event) {
64 return true;
65 }
66
67 void TestWindowDelegate::OnActivated() {
68 }
69
70 void TestWindowDelegate::OnLostActive() {
71 }
72
73 void TestWindowDelegate::OnCaptureLost() { 63 void TestWindowDelegate::OnCaptureLost() {
74 } 64 }
75 65
76 void TestWindowDelegate::OnPaint(gfx::Canvas* canvas) { 66 void TestWindowDelegate::OnPaint(gfx::Canvas* canvas) {
77 } 67 }
78 68
79 void TestWindowDelegate::OnWindowDestroying() { 69 void TestWindowDelegate::OnWindowDestroying() {
80 } 70 }
81 71
82 void TestWindowDelegate::OnWindowDestroyed() { 72 void TestWindowDelegate::OnWindowDestroyed() {
(...skipping 17 matching lines...) Expand all
100 last_key_code_ = event->key_code(); 90 last_key_code_ = event->key_code();
101 return true; 91 return true;
102 } 92 }
103 void ColorTestWindowDelegate::OnWindowDestroyed() { 93 void ColorTestWindowDelegate::OnWindowDestroyed() {
104 delete this; 94 delete this;
105 } 95 }
106 void ColorTestWindowDelegate::OnPaint(gfx::Canvas* canvas) { 96 void ColorTestWindowDelegate::OnPaint(gfx::Canvas* canvas) {
107 canvas->GetSkCanvas()->drawColor(color_, SkXfermode::kSrc_Mode); 97 canvas->GetSkCanvas()->drawColor(color_, SkXfermode::kSrc_Mode);
108 } 98 }
109 99
110 ////////////////////////////////////////////////////////////////////////////////
111 // ActivateWindowDelegate
112
113 ActivateWindowDelegate::ActivateWindowDelegate()
114 : activate_(true),
115 activated_count_(0),
116 lost_active_count_(0),
117 should_activate_count_(0) {
118 }
119
120 ActivateWindowDelegate::ActivateWindowDelegate(bool activate)
121 : activate_(activate),
122 activated_count_(0),
123 lost_active_count_(0),
124 should_activate_count_(0) {
125 }
126
127 bool ActivateWindowDelegate::ShouldActivate(Event* event) {
128 should_activate_count_++;
129 return activate_;
130 }
131 void ActivateWindowDelegate::OnActivated() {
132 activated_count_++;
133 }
134 void ActivateWindowDelegate::OnLostActive() {
135 lost_active_count_++;
136 }
137
138 } // namespace test 100 } // namespace test
139 } // namespace aura 101 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/test_window_delegate.h ('k') | ui/aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698