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

Side by Side Diff: ui/views/bubble/bubble_frame_view.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Sync with ToT Created 3 years, 6 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
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/views/bubble/bubble_frame_view.h" 5 #include "ui/views/bubble/bubble_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 void BubbleFrameView::OnPaint(gfx::Canvas* canvas) { 378 void BubbleFrameView::OnPaint(gfx::Canvas* canvas) {
379 OnPaintBackground(canvas); 379 OnPaintBackground(canvas);
380 // Border comes after children. 380 // Border comes after children.
381 } 381 }
382 382
383 void BubbleFrameView::PaintChildren(const ui::PaintContext& context) { 383 void BubbleFrameView::PaintChildren(const ui::PaintContext& context) {
384 NonClientFrameView::PaintChildren(context); 384 NonClientFrameView::PaintChildren(context);
385 385
386 ui::PaintCache paint_cache; 386 ui::PaintCache paint_cache;
387 ui::PaintRecorder recorder(context, size(), &paint_cache); 387 ui::PaintRecorder recorder(context, context.ScaleToEffectivePixelSize(size()),
oshima 2017/06/16 00:15:03 shouldn't this be context.pixel_size()? and if so,
malaykeshav 2017/06/16 20:41:58 I think its not always the case. But in this case
388 &paint_cache);
388 OnPaintBorder(recorder.canvas()); 389 OnPaintBorder(recorder.canvas());
389 } 390 }
390 391
391 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { 392 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) {
392 if (sender == close_) { 393 if (sender == close_) {
393 close_button_clicked_ = true; 394 close_button_clicked_ = true;
394 GetWidget()->Close(); 395 GetWidget()->Close();
395 } 396 }
396 } 397 }
397 398
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 547
547 DialogDelegate* dialog_delegate = 548 DialogDelegate* dialog_delegate =
548 GetWidget()->widget_delegate()->AsDialogDelegate(); 549 GetWidget()->widget_delegate()->AsDialogDelegate();
549 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth()) 550 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth())
550 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width())); 551 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width()));
551 552
552 return size; 553 return size;
553 } 554 }
554 555
555 } // namespace views 556 } // namespace views
OLDNEW
« ui/compositor/paint_context.cc ('K') | « ui/gfx/canvas.cc ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698