Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc

Issue 2785683003: views: implement width snapping for DialogDelegateViews (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/desktop_capture/desktop_media_picker_views.h" 5 #include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "chrome/browser/media/webrtc/desktop_media_list.h" 8 #include "chrome/browser/media/webrtc/desktop_media_list.h"
9 #include "chrome/browser/ui/browser_finder.h" 9 #include "chrome/browser/ui/browser_finder.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 NOTREACHED(); 267 NOTREACHED();
268 break; 268 break;
269 } 269 }
270 } 270 }
271 } 271 }
272 272
273 void DesktopMediaPickerDialogView::DetachParent() { 273 void DesktopMediaPickerDialogView::DetachParent() {
274 parent_ = nullptr; 274 parent_ = nullptr;
275 } 275 }
276 276
277 gfx::Size DesktopMediaPickerDialogView::GetPreferredSize() const {
278 static const size_t kDialogViewWidth = 600;
279 return gfx::Size(kDialogViewWidth, GetHeightForWidth(kDialogViewWidth));
280 }
281
282 ui::ModalType DesktopMediaPickerDialogView::GetModalType() const { 277 ui::ModalType DesktopMediaPickerDialogView::GetModalType() const {
283 return ui::MODAL_TYPE_CHILD; 278 return ui::MODAL_TYPE_CHILD;
284 } 279 }
285 280
281 gfx::Size DesktopMediaPickerDialogView::GetUnsnappedPreferredSize() const {
282 static const size_t kDialogViewWidth = 600;
Peter Kasting 2017/03/30 00:35:34 Another case that needs a bug in the spreadsheet a
283 return gfx::Size(kDialogViewWidth, GetHeightForWidth(kDialogViewWidth));
284 }
285
286 base::string16 DesktopMediaPickerDialogView::GetWindowTitle() const { 286 base::string16 DesktopMediaPickerDialogView::GetWindowTitle() const {
287 return l10n_util::GetStringUTF16(IDS_DESKTOP_MEDIA_PICKER_TITLE); 287 return l10n_util::GetStringUTF16(IDS_DESKTOP_MEDIA_PICKER_TITLE);
288 } 288 }
289 289
290 bool DesktopMediaPickerDialogView::IsDialogButtonEnabled( 290 bool DesktopMediaPickerDialogView::IsDialogButtonEnabled(
291 ui::DialogButton button) const { 291 ui::DialogButton button) const {
292 if (button == ui::DIALOG_BUTTON_OK) 292 if (button == ui::DIALOG_BUTTON_OK)
293 return list_views_[pane_->GetSelectedTabIndex()]->GetSelection() != nullptr; 293 return list_views_[pane_->GetSelectedTabIndex()]->GetSelection() != nullptr;
294 return true; 294 return true;
295 } 295 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 // DesktopMediaPicker. 447 // DesktopMediaPicker.
448 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, 448 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
449 base::Bind(callback_, source)); 449 base::Bind(callback_, source));
450 callback_.Reset(); 450 callback_.Reset();
451 } 451 }
452 452
453 // static 453 // static
454 std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { 454 std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() {
455 return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); 455 return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews());
456 } 456 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698