| 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 "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
| 9 #include "chrome/browser/chooser_controller/chooser_controller.h" | 9 #include "chrome/browser/chooser_controller/chooser_controller.h" |
| 10 #include "chrome/browser/extensions/api/chrome_device_permissions_prompt.h" | 10 #include "chrome/browser/extensions/api/chrome_device_permissions_prompt.h" |
| 11 #include "chrome/browser/extensions/chrome_extension_chooser_dialog.h" | 11 #include "chrome/browser/extensions/chrome_extension_chooser_dialog.h" |
| 12 #include "chrome/browser/extensions/device_permissions_dialog_controller.h" | 12 #include "chrome/browser/extensions/device_permissions_dialog_controller.h" |
| 13 #include "chrome/browser/ui/browser_dialogs.h" |
| 13 #include "chrome/browser/ui/views/device_chooser_content_view.h" | 14 #include "chrome/browser/ui/views/device_chooser_content_view.h" |
| 14 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" | 15 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" |
| 15 #include "components/constrained_window/constrained_window_views.h" | 16 #include "components/constrained_window/constrained_window_views.h" |
| 16 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 17 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 18 #include "ui/gfx/geometry/insets.h" | 19 #include "ui/gfx/geometry/insets.h" |
| 19 #include "ui/views/background.h" | 20 #include "ui/views/background.h" |
| 20 #include "ui/views/controls/link.h" | 21 #include "ui/views/controls/link.h" |
| 21 #include "ui/views/controls/styled_label.h" | 22 #include "ui/views/controls/styled_label.h" |
| 22 #include "ui/views/layout/fill_layout.h" | 23 #include "ui/views/layout/fill_layout.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 // | | | | | 36 // | | | | |
| 36 // | -------------------------------- | | 37 // | -------------------------------- | |
| 37 // | [ Connect ] [ Cancel ] | | 38 // | [ Connect ] [ Cancel ] | |
| 38 // |----------------------------------| | 39 // |----------------------------------| |
| 39 // | Get help | | 40 // | Get help | |
| 40 // ------------------------------------ | 41 // ------------------------------------ |
| 41 | 42 |
| 42 DCHECK(chooser_controller); | 43 DCHECK(chooser_controller); |
| 43 device_chooser_content_view_ = | 44 device_chooser_content_view_ = |
| 44 new DeviceChooserContentView(this, std::move(chooser_controller)); | 45 new DeviceChooserContentView(this, std::move(chooser_controller)); |
| 46 chrome::RecordDialogCreation(chrome::DialogIdentifier::CHOOSER); |
| 45 } | 47 } |
| 46 | 48 |
| 47 ChooserDialogView::~ChooserDialogView() {} | 49 ChooserDialogView::~ChooserDialogView() {} |
| 48 | 50 |
| 49 base::string16 ChooserDialogView::GetWindowTitle() const { | 51 base::string16 ChooserDialogView::GetWindowTitle() const { |
| 50 return device_chooser_content_view_->GetWindowTitle(); | 52 return device_chooser_content_view_->GetWindowTitle(); |
| 51 } | 53 } |
| 52 | 54 |
| 53 bool ChooserDialogView::ShouldShowCloseButton() const { | 55 bool ChooserDialogView::ShouldShowCloseButton() const { |
| 54 return false; | 56 return false; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 void ChromeDevicePermissionsPrompt::ShowDialogViews() { | 145 void ChromeDevicePermissionsPrompt::ShowDialogViews() { |
| 144 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 146 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 145 | 147 |
| 146 std::unique_ptr<ChooserController> chooser_controller( | 148 std::unique_ptr<ChooserController> chooser_controller( |
| 147 new DevicePermissionsDialogController(web_contents()->GetMainFrame(), | 149 new DevicePermissionsDialogController(web_contents()->GetMainFrame(), |
| 148 prompt())); | 150 prompt())); |
| 149 | 151 |
| 150 constrained_window::ShowWebModalDialogViews( | 152 constrained_window::ShowWebModalDialogViews( |
| 151 new ChooserDialogView(std::move(chooser_controller)), web_contents()); | 153 new ChooserDialogView(std::move(chooser_controller)), web_contents()); |
| 152 } | 154 } |
| OLD | NEW |