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 "chrome/browser/ui/views/confirm_bubble_views.h" | 5 #include "chrome/browser/ui/views/confirm_bubble_views.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "chrome/browser/ui/browser_dialogs.h" | 9 #include "chrome/browser/ui/browser_dialogs.h" |
10 #include "chrome/browser/ui/confirm_bubble.h" | 10 #include "chrome/browser/ui/confirm_bubble.h" |
11 #include "chrome/browser/ui/confirm_bubble_model.h" | 11 #include "chrome/browser/ui/confirm_bubble_model.h" |
12 #include "components/constrained_window/constrained_window_views.h" | 12 #include "components/constrained_window/constrained_window_views.h" |
13 #include "ui/base/ui_features.h" | 13 #include "ui/base/ui_features.h" |
14 #include "ui/views/controls/label.h" | 14 #include "ui/views/controls/label.h" |
15 #include "ui/views/controls/link.h" | 15 #include "ui/views/controls/link.h" |
16 #include "ui/views/layout/grid_layout.h" | 16 #include "ui/views/layout/grid_layout.h" |
17 #include "ui/views/layout/layout_constants.h" | |
18 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
19 | 18 |
20 ConfirmBubbleViews::ConfirmBubbleViews( | 19 ConfirmBubbleViews::ConfirmBubbleViews( |
21 std::unique_ptr<ConfirmBubbleModel> model) | 20 std::unique_ptr<ConfirmBubbleModel> model) |
22 : model_(std::move(model)), link_(NULL) { | 21 : model_(std::move(model)), link_(NULL) { |
23 views::GridLayout* layout = views::GridLayout::CreatePanel(this); | 22 views::GridLayout* layout = views::GridLayout::CreatePanel(this); |
24 | 23 |
25 // Use a fixed maximum message width, so longer messages will wrap. | 24 // Use a fixed maximum message width, so longer messages will wrap. |
26 const int kMaxMessageWidth = 400; | 25 const int kMaxMessageWidth = 400; |
27 views::ColumnSet* cs = layout->AddColumnSet(0); | 26 views::ColumnSet* cs = layout->AddColumnSet(0); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 gfx::NativeView anchor_view, | 108 gfx::NativeView anchor_view, |
110 const gfx::Point& origin, | 109 const gfx::Point& origin, |
111 std::unique_ptr<ConfirmBubbleModel> model) { | 110 std::unique_ptr<ConfirmBubbleModel> model) { |
112 constrained_window::CreateBrowserModalDialogViews( | 111 constrained_window::CreateBrowserModalDialogViews( |
113 new ConfirmBubbleViews(std::move(model)), window) | 112 new ConfirmBubbleViews(std::move(model)), window) |
114 ->Show(); | 113 ->Show(); |
115 } | 114 } |
116 #endif // !OS_MACOSX || MAC_VIEWS_BROWSER | 115 #endif // !OS_MACOSX || MAC_VIEWS_BROWSER |
117 | 116 |
118 } // namespace chrome | 117 } // namespace chrome |
OLD | NEW |