| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/permission_bubble/chooser_bubble_ui.h" | 5 #include "chrome/browser/ui/views/permission_bubble/chooser_bubble_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/chooser_controller/chooser_controller.h" | 14 #include "chrome/browser/chooser_controller/chooser_controller.h" |
| 15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/browser/ui/browser_dialogs.h" |
| 16 #include "chrome/browser/ui/browser_window.h" | 17 #include "chrome/browser/ui/browser_window.h" |
| 17 #include "chrome/browser/ui/permission_bubble/chooser_bubble_delegate.h" | 18 #include "chrome/browser/ui/permission_bubble/chooser_bubble_delegate.h" |
| 18 #include "chrome/browser/ui/views/device_chooser_content_view.h" | 19 #include "chrome/browser/ui/views/device_chooser_content_view.h" |
| 19 #include "components/bubble/bubble_controller.h" | 20 #include "components/bubble/bubble_controller.h" |
| 20 #include "ui/views/bubble/bubble_dialog_delegate.h" | 21 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 21 #include "ui/views/controls/link.h" | 22 #include "ui/views/controls/link.h" |
| 22 #include "ui/views/controls/styled_label.h" | 23 #include "ui/views/controls/styled_label.h" |
| 23 #include "ui/views/controls/table/table_view_observer.h" | 24 #include "ui/views/controls/table/table_view_observer.h" |
| 24 #include "ui/views/window/dialog_client_view.h" | 25 #include "ui/views/window/dialog_client_view.h" |
| 25 | 26 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // | -------------------------------- | | 89 // | -------------------------------- | |
| 89 // | [ Connect ] [ Cancel ] | | 90 // | [ Connect ] [ Cancel ] | |
| 90 // |----------------------------------| | 91 // |----------------------------------| |
| 91 // | Get help | | 92 // | Get help | |
| 92 // ------------------------------------ | 93 // ------------------------------------ |
| 93 | 94 |
| 94 device_chooser_content_view_ = | 95 device_chooser_content_view_ = |
| 95 new DeviceChooserContentView(this, std::move(chooser_controller)); | 96 new DeviceChooserContentView(this, std::move(chooser_controller)); |
| 96 if (!anchor_view) | 97 if (!anchor_view) |
| 97 SetAnchorRect(gfx::Rect(anchor_point, gfx::Size())); | 98 SetAnchorRect(gfx::Rect(anchor_point, gfx::Size())); |
| 99 chrome::RecordDialogCreation(chrome::DialogIdentifier::CHOOSER_UI); |
| 98 } | 100 } |
| 99 | 101 |
| 100 ChooserBubbleUiViewDelegate::~ChooserBubbleUiViewDelegate() {} | 102 ChooserBubbleUiViewDelegate::~ChooserBubbleUiViewDelegate() {} |
| 101 | 103 |
| 102 base::string16 ChooserBubbleUiViewDelegate::GetWindowTitle() const { | 104 base::string16 ChooserBubbleUiViewDelegate::GetWindowTitle() const { |
| 103 return device_chooser_content_view_->GetWindowTitle(); | 105 return device_chooser_content_view_->GetWindowTitle(); |
| 104 } | 106 } |
| 105 | 107 |
| 106 base::string16 ChooserBubbleUiViewDelegate::GetDialogButtonLabel( | 108 base::string16 ChooserBubbleUiViewDelegate::GetDialogButtonLabel( |
| 107 ui::DialogButton button) const { | 109 ui::DialogButton button) const { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 CreateAndShow(chooser_bubble_ui_view_delegate_); | 196 CreateAndShow(chooser_bubble_ui_view_delegate_); |
| 195 chooser_bubble_ui_view_delegate_->UpdateTableView(); | 197 chooser_bubble_ui_view_delegate_->UpdateTableView(); |
| 196 } | 198 } |
| 197 | 199 |
| 198 void ChooserBubbleUi::Close() {} | 200 void ChooserBubbleUi::Close() {} |
| 199 | 201 |
| 200 void ChooserBubbleUi::UpdateAnchorPosition() { | 202 void ChooserBubbleUi::UpdateAnchorPosition() { |
| 201 chooser_bubble_ui_view_delegate_->UpdateAnchor(GetAnchorView(), | 203 chooser_bubble_ui_view_delegate_->UpdateAnchor(GetAnchorView(), |
| 202 GetAnchorArrow()); | 204 GetAnchorArrow()); |
| 203 } | 205 } |
| OLD | NEW |