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

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

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Merged PaintContext Offset into paint_recording_bounds_ Created 3 years, 5 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 395
396 void BubbleFrameView::OnPaint(gfx::Canvas* canvas) { 396 void BubbleFrameView::OnPaint(gfx::Canvas* canvas) {
397 OnPaintBackground(canvas); 397 OnPaintBackground(canvas);
398 // Border comes after children. 398 // Border comes after children.
399 } 399 }
400 400
401 void BubbleFrameView::PaintChildren(const ui::PaintContext& context) { 401 void BubbleFrameView::PaintChildren(const ui::PaintContext& context) {
402 NonClientFrameView::PaintChildren(context); 402 NonClientFrameView::PaintChildren(context);
403 403
404 ui::PaintCache paint_cache; 404 ui::PaintCache paint_cache;
405 ui::PaintRecorder recorder(context, size(), &paint_cache); 405 ui::PaintRecorder recorder(context, context.paint_recording_size(),
406 &paint_cache);
406 OnPaintBorder(recorder.canvas()); 407 OnPaintBorder(recorder.canvas());
407 } 408 }
408 409
409 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { 410 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) {
410 if (sender == close_) { 411 if (sender == close_) {
411 close_button_clicked_ = true; 412 close_button_clicked_ = true;
412 GetWidget()->Close(); 413 GetWidget()->Close();
413 } 414 }
414 } 415 }
415 416
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 565
565 DialogDelegate* dialog_delegate = 566 DialogDelegate* dialog_delegate =
566 GetWidget()->widget_delegate()->AsDialogDelegate(); 567 GetWidget()->widget_delegate()->AsDialogDelegate();
567 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth()) 568 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth())
568 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width())); 569 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width()));
569 570
570 return size; 571 return size;
571 } 572 }
572 573
573 } // namespace views 574 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698