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

Side by Side Diff: chrome/browser/ui/views/create_application_shortcut_view.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/create_application_shortcut_view.h" 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 layout->AddView(menu_check_box_); 313 layout->AddView(menu_check_box_);
314 } 314 }
315 315
316 if (quick_launch_check_box_ != nullptr) { 316 if (quick_launch_check_box_ != nullptr) {
317 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); 317 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
318 layout->StartRow(0, kTableColumnSetId); 318 layout->StartRow(0, kTableColumnSetId);
319 layout->AddView(quick_launch_check_box_); 319 layout->AddView(quick_launch_check_box_);
320 } 320 }
321 } 321 }
322 322
323 gfx::Size CreateApplicationShortcutView::GetPreferredSize() const { 323 gfx::Size CreateApplicationShortcutView::GetUnsnappedPreferredSize() const {
324 // TODO(evanm): should this use IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS? 324 // TODO(evanm): should this use IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS?
Peter Kasting 2017/03/30 00:35:34 Yes, or that should be removed, because it's unuse
325 static const int kDialogWidth = 360; 325 static const int kDialogWidth = 360;
326 int height = GetLayoutManager()->GetPreferredHeightForWidth(this, 326 int height = GetLayoutManager()->GetPreferredHeightForWidth(this,
327 kDialogWidth); 327 kDialogWidth);
Peter Kasting 2017/03/30 00:35:34 This is just GetHeightForWidth().
328 return gfx::Size(kDialogWidth, height); 328 return gfx::Size(kDialogWidth, height);
329 } 329 }
330 330
331 base::string16 CreateApplicationShortcutView::GetDialogButtonLabel( 331 base::string16 CreateApplicationShortcutView::GetDialogButtonLabel(
332 ui::DialogButton button) const { 332 ui::DialogButton button) const {
333 if (button == ui::DIALOG_BUTTON_OK) 333 if (button == ui::DIALOG_BUTTON_OK)
334 return l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_COMMIT); 334 return l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_COMMIT);
335 return views::DialogDelegateView::GetDialogButtonLabel(button); 335 return views::DialogDelegateView::GetDialogButtonLabel(button);
336 } 336 }
337 337
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 bool CreateChromeApplicationShortcutView::Cancel() { 537 bool CreateChromeApplicationShortcutView::Cancel() {
538 if (!close_callback_.is_null()) 538 if (!close_callback_.is_null())
539 close_callback_.Run(false); 539 close_callback_.Run(false);
540 return CreateApplicationShortcutView::Cancel(); 540 return CreateApplicationShortcutView::Cancel();
541 } 541 }
542 542
543 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( 543 void CreateChromeApplicationShortcutView::OnAppInfoLoaded(
544 std::unique_ptr<web_app::ShortcutInfo> shortcut_info) { 544 std::unique_ptr<web_app::ShortcutInfo> shortcut_info) {
545 shortcut_info_ = std::move(shortcut_info); 545 shortcut_info_ = std::move(shortcut_info);
546 } 546 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698