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

Side by Side Diff: ui/views/widget/widget_unittest.cc

Issue 1057873004: Pass a ui::PaintContext from ui::Layer to layer delegates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layer-paintcontext: mac Created 5 years, 8 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/widget/widget.cc ('k') | ui/wm/core/image_grid.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) 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 <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 void Close() override { 1292 void Close() override {
1293 expect_paint_ = false; 1293 expect_paint_ = false;
1294 views::Widget::Close(); 1294 views::Widget::Close();
1295 } 1295 }
1296 1296
1297 void Hide() { 1297 void Hide() {
1298 expect_paint_ = false; 1298 expect_paint_ = false;
1299 views::Widget::Hide(); 1299 views::Widget::Hide();
1300 } 1300 }
1301 1301
1302 void OnNativeWidgetPaint(gfx::Canvas* canvas) override { 1302 void OnNativeWidgetPaint(const ui::PaintContext& context) override {
1303 received_paint_ = true; 1303 received_paint_ = true;
1304 EXPECT_TRUE(expect_paint_); 1304 EXPECT_TRUE(expect_paint_);
1305 if (!expect_paint_) 1305 if (!expect_paint_)
1306 received_paint_while_hidden_ = true; 1306 received_paint_while_hidden_ = true;
1307 views::Widget::OnNativeWidgetPaint(canvas); 1307 views::Widget::OnNativeWidgetPaint(context);
1308 } 1308 }
1309 1309
1310 bool ReadReceivedPaintAndReset() { 1310 bool ReadReceivedPaintAndReset() {
1311 bool result = received_paint_; 1311 bool result = received_paint_;
1312 received_paint_ = false; 1312 received_paint_ = false;
1313 return result; 1313 return result;
1314 } 1314 }
1315 1315
1316 bool received_paint_while_hidden() const { 1316 bool received_paint_while_hidden() const {
1317 return received_paint_while_hidden_; 1317 return received_paint_while_hidden_;
(...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after
3331 bool handled = false; 3331 bool handled = false;
3332 target->HandleKeyboardMessage(WM_CHAR, 0, 0, &handled); 3332 target->HandleKeyboardMessage(WM_CHAR, 0, 0, &handled);
3333 target->HandleKeyboardMessage(WM_SYSCHAR, 0, 0, &handled); 3333 target->HandleKeyboardMessage(WM_SYSCHAR, 0, 0, &handled);
3334 target->HandleKeyboardMessage(WM_SYSDEADCHAR, 0, 0, &handled); 3334 target->HandleKeyboardMessage(WM_SYSDEADCHAR, 0, 0, &handled);
3335 widget.CloseNow(); 3335 widget.CloseNow();
3336 } 3336 }
3337 #endif 3337 #endif
3338 3338
3339 } // namespace test 3339 } // namespace test
3340 } // namespace views 3340 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget.cc ('k') | ui/wm/core/image_grid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698