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

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

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: nits 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.pixel_size(), &paint_cache);
388 OnPaintBorder(recorder.canvas()); 388 OnPaintBorder(recorder.canvas());
389 } 389 }
390 390
391 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { 391 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) {
392 if (sender == close_) { 392 if (sender == close_) {
393 close_button_clicked_ = true; 393 close_button_clicked_ = true;
394 GetWidget()->Close(); 394 GetWidget()->Close();
395 } 395 }
396 } 396 }
397 397
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 546
547 DialogDelegate* dialog_delegate = 547 DialogDelegate* dialog_delegate =
548 GetWidget()->widget_delegate()->AsDialogDelegate(); 548 GetWidget()->widget_delegate()->AsDialogDelegate();
549 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth()) 549 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth())
550 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width())); 550 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width()));
551 551
552 return size; 552 return size;
553 } 553 }
554 554
555 } // namespace views 555 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698