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

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

Issue 8926004: Revert 114095 - 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
63 void TestWindowDelegate::OnCaptureLost() { 73 void TestWindowDelegate::OnCaptureLost() {
64 } 74 }
65 75
66 void TestWindowDelegate::OnPaint(gfx::Canvas* canvas) { 76 void TestWindowDelegate::OnPaint(gfx::Canvas* canvas) {
67 } 77 }
68 78
69 void TestWindowDelegate::OnWindowDestroying() { 79 void TestWindowDelegate::OnWindowDestroying() {
70 } 80 }
71 81
72 void TestWindowDelegate::OnWindowDestroyed() { 82 void TestWindowDelegate::OnWindowDestroyed() {
(...skipping 17 matching lines...) Expand all
90 last_key_code_ = event->key_code(); 100 last_key_code_ = event->key_code();
91 return true; 101 return true;
92 } 102 }
93 void ColorTestWindowDelegate::OnWindowDestroyed() { 103 void ColorTestWindowDelegate::OnWindowDestroyed() {
94 delete this; 104 delete this;
95 } 105 }
96 void ColorTestWindowDelegate::OnPaint(gfx::Canvas* canvas) { 106 void ColorTestWindowDelegate::OnPaint(gfx::Canvas* canvas) {
97 canvas->GetSkCanvas()->drawColor(color_, SkXfermode::kSrc_Mode); 107 canvas->GetSkCanvas()->drawColor(color_, SkXfermode::kSrc_Mode);
98 } 108 }
99 109
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
100 } // namespace test 138 } // namespace test
101 } // namespace aura 139 } // 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