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

Side by Side Diff: ui/views/view_unittest.cc

Issue 1029943002: views: Make View::Paint non-virtual. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: paint-virtual: . Created 5 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
« no previous file with comments | « ui/views/view.h ('k') | no next file » | 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 <map> 5 #include <map>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 return can_process_events_within_subtree_; 233 return can_process_events_within_subtree_;
234 } 234 }
235 235
236 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; 236 void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
237 bool OnMousePressed(const ui::MouseEvent& event) override; 237 bool OnMousePressed(const ui::MouseEvent& event) override;
238 bool OnMouseDragged(const ui::MouseEvent& event) override; 238 bool OnMouseDragged(const ui::MouseEvent& event) override;
239 void OnMouseReleased(const ui::MouseEvent& event) override; 239 void OnMouseReleased(const ui::MouseEvent& event) override;
240 void OnMouseEntered(const ui::MouseEvent& event) override; 240 void OnMouseEntered(const ui::MouseEvent& event) override;
241 void OnMouseExited(const ui::MouseEvent& event) override; 241 void OnMouseExited(const ui::MouseEvent& event) override;
242 242
243 void Paint(gfx::Canvas* canvas, const CullSet& cull_set) override; 243 void OnPaint(gfx::Canvas* canvas) override;
244 void SchedulePaintInRect(const gfx::Rect& rect) override; 244 void SchedulePaintInRect(const gfx::Rect& rect) override;
245 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; 245 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
246 246
247 void OnNativeThemeChanged(const ui::NativeTheme* native_theme) override; 247 void OnNativeThemeChanged(const ui::NativeTheme* native_theme) override;
248 248
249 // OnBoundsChanged. 249 // OnBoundsChanged.
250 bool did_change_bounds_; 250 bool did_change_bounds_;
251 gfx::Rect new_bounds_; 251 gfx::Rect new_bounds_;
252 252
253 // MouseEvent. 253 // MouseEvent.
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 root->OnMousePressed(pressed); 416 root->OnMousePressed(pressed);
417 EXPECT_EQ(0, v1->child_count()); 417 EXPECT_EQ(0, v1->child_count());
418 418
419 widget->CloseNow(); 419 widget->CloseNow();
420 } 420 }
421 421
422 //////////////////////////////////////////////////////////////////////////////// 422 ////////////////////////////////////////////////////////////////////////////////
423 // Painting 423 // Painting
424 //////////////////////////////////////////////////////////////////////////////// 424 ////////////////////////////////////////////////////////////////////////////////
425 425
426 void TestView::Paint(gfx::Canvas* canvas, const CullSet& cull_set) { 426 void TestView::OnPaint(gfx::Canvas* canvas) {
427 canvas->sk_canvas()->getClipBounds(&last_clip_); 427 canvas->sk_canvas()->getClipBounds(&last_clip_);
428 } 428 }
429 429
430 void TestView::SchedulePaintInRect(const gfx::Rect& rect) { 430 void TestView::SchedulePaintInRect(const gfx::Rect& rect) {
431 scheduled_paint_rects_.push_back(rect); 431 scheduled_paint_rects_.push_back(rect);
432 View::SchedulePaintInRect(rect); 432 View::SchedulePaintInRect(rect);
433 } 433 }
434 434
435 void CheckRect(const SkRect& check_rect, const SkRect& target_rect) { 435 void CheckRect(const SkRect& check_rect, const SkRect& target_rect) {
436 EXPECT_EQ(target_rect.fLeft, check_rect.fLeft); 436 EXPECT_EQ(target_rect.fLeft, check_rect.fLeft);
(...skipping 3297 matching lines...) Expand 10 before | Expand all | Expand 10 after
3734 // notification. 3734 // notification.
3735 TestView* test_view_child_2 = new TestView(); 3735 TestView* test_view_child_2 = new TestView();
3736 test_view->AddChildView(test_view_child_2); 3736 test_view->AddChildView(test_view_child_2);
3737 EXPECT_TRUE(test_view_child_2->native_theme_); 3737 EXPECT_TRUE(test_view_child_2->native_theme_);
3738 EXPECT_EQ(widget->GetNativeTheme(), test_view_child_2->native_theme_); 3738 EXPECT_EQ(widget->GetNativeTheme(), test_view_child_2->native_theme_);
3739 3739
3740 widget->CloseNow(); 3740 widget->CloseNow();
3741 } 3741 }
3742 3742
3743 } // namespace views 3743 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698