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

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

Issue 13008024: Fixes bug where FocusController would stack a layer directly above a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't stack on top of same window Created 7 years, 9 months 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/views/corewm/focus_controller.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/base/events/event.h" 9 #include "ui/base/events/event.h"
10 #include "ui/base/hit_test.h" 10 #include "ui/base/hit_test.h"
11 #include "ui/gfx/canvas.h" 11 #include "ui/gfx/canvas.h"
12 #include "ui/gfx/path.h" 12 #include "ui/gfx/path.h"
13 #include "ui/gfx/skia_util.h" 13 #include "ui/gfx/skia_util.h"
14 14
15 namespace aura { 15 namespace aura {
16 namespace test { 16 namespace test {
17 17
18 //////////////////////////////////////////////////////////////////////////////// 18 ////////////////////////////////////////////////////////////////////////////////
19 // TestWindowDelegate 19 // TestWindowDelegate
20 20
21 TestWindowDelegate::TestWindowDelegate() 21 TestWindowDelegate::TestWindowDelegate()
22 : window_component_(HTCLIENT), 22 : window_component_(HTCLIENT),
23 delete_on_destroyed_(false) { 23 delete_on_destroyed_(false),
24 can_focus_(true) {
24 } 25 }
25 26
26 TestWindowDelegate::~TestWindowDelegate() { 27 TestWindowDelegate::~TestWindowDelegate() {
27 } 28 }
28 29
29 // static 30 // static
30 TestWindowDelegate* TestWindowDelegate::CreateSelfDestroyingDelegate() { 31 TestWindowDelegate* TestWindowDelegate::CreateSelfDestroyingDelegate() {
31 TestWindowDelegate* delegate = new TestWindowDelegate; 32 TestWindowDelegate* delegate = new TestWindowDelegate;
32 delegate->delete_on_destroyed_ = true; 33 delegate->delete_on_destroyed_ = true;
33 return delegate; 34 return delegate;
(...skipping 19 matching lines...) Expand all
53 return window_component_; 54 return window_component_;
54 } 55 }
55 56
56 bool TestWindowDelegate::ShouldDescendIntoChildForEventHandling( 57 bool TestWindowDelegate::ShouldDescendIntoChildForEventHandling(
57 Window* child, 58 Window* child,
58 const gfx::Point& location) { 59 const gfx::Point& location) {
59 return true; 60 return true;
60 } 61 }
61 62
62 bool TestWindowDelegate::CanFocus() { 63 bool TestWindowDelegate::CanFocus() {
63 return true; 64 return can_focus_;
64 } 65 }
65 66
66 void TestWindowDelegate::OnCaptureLost() { 67 void TestWindowDelegate::OnCaptureLost() {
67 } 68 }
68 69
69 void TestWindowDelegate::OnPaint(gfx::Canvas* canvas) { 70 void TestWindowDelegate::OnPaint(gfx::Canvas* canvas) {
70 } 71 }
71 72
72 void TestWindowDelegate::OnDeviceScaleFactorChanged( 73 void TestWindowDelegate::OnDeviceScaleFactorChanged(
73 float device_scale_factor) { 74 float device_scale_factor) {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 std::string result = base::StringPrintf("%d %d", 207 std::string result = base::StringPrintf("%d %d",
207 key_press_count_, 208 key_press_count_,
208 key_release_count_); 209 key_release_count_);
209 key_press_count_ = 0; 210 key_press_count_ = 0;
210 key_release_count_ = 0; 211 key_release_count_ = 0;
211 return result; 212 return result;
212 } 213 }
213 214
214 } // namespace test 215 } // namespace test
215 } // namespace aura 216 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/test_window_delegate.h ('k') | ui/views/corewm/focus_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698