| 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 11 matching lines...) Expand all Loading... |
| 22 // | -------------------------------- | | 22 // | -------------------------------- | |
| 23 // | | option 0 | | | 23 // | | option 0 | | |
| 24 // | | option 1 | | | 24 // | | option 1 | | |
| 25 // | | option 2 | | | 25 // | | option 2 | | |
| 26 // | | | | | 26 // | | | | |
| 27 // | | | | | 27 // | | | | |
| 28 // | | | | | 28 // | | | | |
| 29 // | -------------------------------- | | 29 // | -------------------------------- | |
| 30 // | [ Connect ] [ Cancel ] | | 30 // | [ Connect ] [ Cancel ] | |
| 31 // |----------------------------------| | 31 // |----------------------------------| |
| 32 // | Not seeing your device? Get help | | 32 // | Get help | |
| 33 // ------------------------------------ | 33 // ------------------------------------ |
| 34 | 34 |
| 35 DCHECK(chooser_controller); | 35 DCHECK(chooser_controller); |
| 36 chooser_content_view_ = | 36 chooser_content_view_ = |
| 37 new ChooserContentView(this, std::move(chooser_controller)); | 37 new ChooserContentView(this, std::move(chooser_controller)); |
| 38 } | 38 } |
| 39 | 39 |
| 40 ChooserDialogView::~ChooserDialogView() {} | 40 ChooserDialogView::~ChooserDialogView() {} |
| 41 | 41 |
| 42 base::string16 ChooserDialogView::GetWindowTitle() const { | 42 base::string16 ChooserDialogView::GetWindowTitle() const { |
| (...skipping 10 matching lines...) Expand all 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 | |
| 67 views::View* ChooserDialogView::CreateFootnoteView() { | 63 views::View* ChooserDialogView::CreateFootnoteView() { |
| 68 return chooser_content_view_->CreateFootnoteView(); | 64 return chooser_content_view_->CreateFootnoteView(); |
| 69 } | 65 } |
| 70 | 66 |
| 71 bool ChooserDialogView::Accept() { | 67 bool ChooserDialogView::Accept() { |
| 72 chooser_content_view_->Accept(); | 68 chooser_content_view_->Accept(); |
| 73 return true; | 69 return true; |
| 74 } | 70 } |
| 75 | 71 |
| 76 bool ChooserDialogView::Cancel() { | 72 bool ChooserDialogView::Cancel() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 104 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 109 DCHECK(chooser_controller); | 105 DCHECK(chooser_controller); |
| 110 | 106 |
| 111 web_modal::WebContentsModalDialogManager* manager = | 107 web_modal::WebContentsModalDialogManager* manager = |
| 112 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents_); | 108 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents_); |
| 113 if (manager) { | 109 if (manager) { |
| 114 constrained_window::ShowWebModalDialogViews( | 110 constrained_window::ShowWebModalDialogViews( |
| 115 new ChooserDialogView(std::move(chooser_controller)), web_contents_); | 111 new ChooserDialogView(std::move(chooser_controller)), web_contents_); |
| 116 } | 112 } |
| 117 } | 113 } |
| OLD | NEW |