| OLD | NEW |
| 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" |
| 11 #include "ui/base/default_style.h" | 11 #include "ui/base/default_style.h" |
| 12 #include "ui/base/hit_test.h" | 12 #include "ui/base/hit_test.h" |
| 13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
| 14 #include "ui/base/material_design/material_design_controller.h" | 14 #include "ui/base/material_design/material_design_controller.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
| 16 #include "ui/compositor/paint_context.h" | 16 #include "ui/compositor/paint_info.h" |
| 17 #include "ui/compositor/paint_recorder.h" | 17 #include "ui/compositor/paint_recorder.h" |
| 18 #include "ui/display/display.h" | 18 #include "ui/display/display.h" |
| 19 #include "ui/display/screen.h" | 19 #include "ui/display/screen.h" |
| 20 #include "ui/gfx/geometry/vector2d.h" | 20 #include "ui/gfx/geometry/vector2d.h" |
| 21 #include "ui/gfx/path.h" | 21 #include "ui/gfx/path.h" |
| 22 #include "ui/gfx/skia_util.h" | 22 #include "ui/gfx/skia_util.h" |
| 23 #include "ui/native_theme/native_theme.h" | 23 #include "ui/native_theme/native_theme.h" |
| 24 #include "ui/resources/grit/ui_resources.h" | 24 #include "ui/resources/grit/ui_resources.h" |
| 25 #include "ui/strings/grit/ui_strings.h" | 25 #include "ui/strings/grit/ui_strings.h" |
| 26 #include "ui/vector_icons/vector_icons.h" | 26 #include "ui/vector_icons/vector_icons.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 footnote_container_->SetVisible(false); | 391 footnote_container_->SetVisible(false); |
| 392 footnote_container_ = nullptr; | 392 footnote_container_ = nullptr; |
| 393 } | 393 } |
| 394 } | 394 } |
| 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::PaintInfo& paint_info) { |
| 402 NonClientFrameView::PaintChildren(context); | 402 NonClientFrameView::PaintChildren(paint_info); |
| 403 | 403 |
| 404 ui::PaintCache paint_cache; | 404 ui::PaintCache paint_cache; |
| 405 ui::PaintRecorder recorder(context, size(), &paint_cache); | 405 ui::PaintRecorder recorder(paint_info, &paint_cache); |
| 406 OnPaintBorder(recorder.canvas()); | 406 OnPaintBorder(recorder.canvas()); |
| 407 } | 407 } |
| 408 | 408 |
| 409 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { | 409 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { |
| 410 if (sender == close_) { | 410 if (sender == close_) { |
| 411 close_button_clicked_ = true; | 411 close_button_clicked_ = true; |
| 412 GetWidget()->Close(); | 412 GetWidget()->Close(); |
| 413 } | 413 } |
| 414 } | 414 } |
| 415 | 415 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 | 564 |
| 565 DialogDelegate* dialog_delegate = | 565 DialogDelegate* dialog_delegate = |
| 566 GetWidget()->widget_delegate()->AsDialogDelegate(); | 566 GetWidget()->widget_delegate()->AsDialogDelegate(); |
| 567 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth()) | 567 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth()) |
| 568 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width())); | 568 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width())); |
| 569 | 569 |
| 570 return size; | 570 return size; |
| 571 } | 571 } |
| 572 | 572 |
| 573 } // namespace views | 573 } // namespace views |
| OLD | NEW |