| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/webshare/webshare_target_picker_view.h" | 5 #include "chrome/browser/ui/views/webshare/webshare_target_picker_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/views/harmony/layout_delegate.h" | 8 #include "chrome/browser/ui/views/harmony/layout_delegate.h" |
| 9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
| 10 #include "components/constrained_window/constrained_window_views.h" | 10 #include "components/constrained_window/constrained_window_views.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 layout->SetFlexForView(table_parent, 1); | 108 layout->SetFlexForView(table_parent, 1); |
| 109 } | 109 } |
| 110 | 110 |
| 111 WebShareTargetPickerView::~WebShareTargetPickerView() { | 111 WebShareTargetPickerView::~WebShareTargetPickerView() { |
| 112 // Clear the pointer from |table_| which currently points at |table_model_|. | 112 // Clear the pointer from |table_| which currently points at |table_model_|. |
| 113 // Otherwise, |table_model_| will be deleted before |table_|, and |table_|'s | 113 // Otherwise, |table_model_| will be deleted before |table_|, and |table_|'s |
| 114 // destructor will try to call a method on the model. | 114 // destructor will try to call a method on the model. |
| 115 table_->SetModel(nullptr); | 115 table_->SetModel(nullptr); |
| 116 } | 116 } |
| 117 | 117 |
| 118 gfx::Size WebShareTargetPickerView::GetPreferredSize() const { | 118 gfx::Size WebShareTargetPickerView::GetUnsnappedPreferredSize() const { |
| 119 return gfx::Size(kDialogWidth, kDialogHeight); | 119 return gfx::Size(kDialogWidth, kDialogHeight); |
| 120 } | 120 } |
| 121 | 121 |
| 122 ui::ModalType WebShareTargetPickerView::GetModalType() const { | 122 ui::ModalType WebShareTargetPickerView::GetModalType() const { |
| 123 return ui::MODAL_TYPE_WINDOW; | 123 return ui::MODAL_TYPE_WINDOW; |
| 124 } | 124 } |
| 125 | 125 |
| 126 base::string16 WebShareTargetPickerView::GetWindowTitle() const { | 126 base::string16 WebShareTargetPickerView::GetWindowTitle() const { |
| 127 return l10n_util::GetStringUTF16(IDS_WEBSHARE_TARGET_PICKER_TITLE); | 127 return l10n_util::GetStringUTF16(IDS_WEBSHARE_TARGET_PICKER_TITLE); |
| 128 } | 128 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 return true; | 160 return true; |
| 161 } | 161 } |
| 162 | 162 |
| 163 void WebShareTargetPickerView::OnSelectionChanged() { | 163 void WebShareTargetPickerView::OnSelectionChanged() { |
| 164 GetDialogClientView()->UpdateDialogButtons(); | 164 GetDialogClientView()->UpdateDialogButtons(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 void WebShareTargetPickerView::OnDoubleClick() { | 167 void WebShareTargetPickerView::OnDoubleClick() { |
| 168 GetDialogClientView()->AcceptWindow(); | 168 GetDialogClientView()->AcceptWindow(); |
| 169 } | 169 } |
| OLD | NEW |