OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/extensions/chooser_dialog_view.h" | 5 #include "chrome/browser/ui/views/extensions/chooser_dialog_view.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/chooser_controller/chooser_controller.h" | 8 #include "chrome/browser/chooser_controller/chooser_controller.h" |
9 #include "chrome/browser/extensions/chrome_extension_chooser_dialog.h" | 9 #include "chrome/browser/extensions/chrome_extension_chooser_dialog.h" |
10 #include "chrome/browser/ui/views/chooser_content_view.h" | 10 #include "chrome/browser/ui/views/chooser_content_view.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 base::string16 ChooserDialogView::GetDialogButtonLabel( | 54 base::string16 ChooserDialogView::GetDialogButtonLabel( |
55 ui::DialogButton button) const { | 55 ui::DialogButton button) const { |
56 return chooser_content_view_->GetDialogButtonLabel(button); | 56 return chooser_content_view_->GetDialogButtonLabel(button); |
57 } | 57 } |
58 | 58 |
59 bool ChooserDialogView::IsDialogButtonEnabled(ui::DialogButton button) const { | 59 bool ChooserDialogView::IsDialogButtonEnabled(ui::DialogButton button) const { |
60 return chooser_content_view_->IsDialogButtonEnabled(button); | 60 return chooser_content_view_->IsDialogButtonEnabled(button); |
61 } | 61 } |
62 | 62 |
| 63 views::View* ChooserDialogView::CreateExtraView() { |
| 64 return chooser_content_view_->CreateExtraView(); |
| 65 } |
| 66 |
63 views::View* ChooserDialogView::CreateFootnoteView() { | 67 views::View* ChooserDialogView::CreateFootnoteView() { |
64 return chooser_content_view_->CreateFootnoteView(this); | 68 return chooser_content_view_->CreateFootnoteView(); |
65 } | 69 } |
66 | 70 |
67 bool ChooserDialogView::Accept() { | 71 bool ChooserDialogView::Accept() { |
68 chooser_content_view_->Accept(); | 72 chooser_content_view_->Accept(); |
69 return true; | 73 return true; |
70 } | 74 } |
71 | 75 |
72 bool ChooserDialogView::Cancel() { | 76 bool ChooserDialogView::Cancel() { |
73 chooser_content_view_->Cancel(); | 77 chooser_content_view_->Cancel(); |
74 return true; | 78 return true; |
75 } | 79 } |
76 | 80 |
77 bool ChooserDialogView::Close() { | 81 bool ChooserDialogView::Close() { |
78 chooser_content_view_->Close(); | 82 chooser_content_view_->Close(); |
79 return true; | 83 return true; |
80 } | 84 } |
81 | 85 |
82 views::View* ChooserDialogView::GetContentsView() { | 86 views::View* ChooserDialogView::GetContentsView() { |
83 return chooser_content_view_; | 87 return chooser_content_view_; |
84 } | 88 } |
85 | 89 |
86 views::Widget* ChooserDialogView::GetWidget() { | 90 views::Widget* ChooserDialogView::GetWidget() { |
87 return chooser_content_view_->GetWidget(); | 91 return chooser_content_view_->GetWidget(); |
88 } | 92 } |
89 | 93 |
90 const views::Widget* ChooserDialogView::GetWidget() const { | 94 const views::Widget* ChooserDialogView::GetWidget() const { |
91 return chooser_content_view_->GetWidget(); | 95 return chooser_content_view_->GetWidget(); |
92 } | 96 } |
93 | 97 |
94 void ChooserDialogView::StyledLabelLinkClicked(views::StyledLabel* label, | |
95 const gfx::Range& range, | |
96 int event_flags) { | |
97 chooser_content_view_->StyledLabelLinkClicked(); | |
98 } | |
99 | |
100 void ChooserDialogView::OnSelectionChanged() { | 98 void ChooserDialogView::OnSelectionChanged() { |
101 GetDialogClientView()->UpdateDialogButtons(); | 99 GetDialogClientView()->UpdateDialogButtons(); |
102 } | 100 } |
103 | 101 |
104 views::TableView* ChooserDialogView::table_view_for_test() const { | 102 ChooserContentView* ChooserDialogView::chooser_content_view_for_test() const { |
105 return chooser_content_view_->table_view_for_test(); | 103 return chooser_content_view_; |
106 } | 104 } |
107 | 105 |
108 void ChromeExtensionChooserDialog::ShowDialogImpl( | 106 void ChromeExtensionChooserDialog::ShowDialogImpl( |
109 std::unique_ptr<ChooserController> chooser_controller) const { | 107 std::unique_ptr<ChooserController> chooser_controller) const { |
110 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 108 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
111 DCHECK(chooser_controller); | 109 DCHECK(chooser_controller); |
112 | 110 |
113 web_modal::WebContentsModalDialogManager* manager = | 111 web_modal::WebContentsModalDialogManager* manager = |
114 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents_); | 112 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents_); |
115 if (manager) { | 113 if (manager) { |
116 constrained_window::ShowWebModalDialogViews( | 114 constrained_window::ShowWebModalDialogViews( |
117 new ChooserDialogView(std::move(chooser_controller)), web_contents_); | 115 new ChooserDialogView(std::move(chooser_controller)), web_contents_); |
118 } | 116 } |
119 } | 117 } |
OLD | NEW |