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

Side by Side Diff: chrome/browser/ui/views/create_application_shortcut_view.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 | Annotate | Revision Log
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 layout->AddView(menu_check_box_); 325 layout->AddView(menu_check_box_);
326 } 326 }
327 327
328 if (quick_launch_check_box_ != NULL) { 328 if (quick_launch_check_box_ != NULL) {
329 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); 329 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
330 layout->StartRow(0, kTableColumnSetId); 330 layout->StartRow(0, kTableColumnSetId);
331 layout->AddView(quick_launch_check_box_); 331 layout->AddView(quick_launch_check_box_);
332 } 332 }
333 } 333 }
334 334
335 gfx::Size CreateApplicationShortcutView::GetPreferredSize() { 335 gfx::Size CreateApplicationShortcutView::GetPreferredSize() const {
336 // TODO(evanm): should this use IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS? 336 // TODO(evanm): should this use IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS?
337 static const int kDialogWidth = 360; 337 static const int kDialogWidth = 360;
338 int height = GetLayoutManager()->GetPreferredHeightForWidth(this, 338 int height = GetLayoutManager()->GetPreferredHeightForWidth(this,
339 kDialogWidth); 339 kDialogWidth);
340 return gfx::Size(kDialogWidth, height); 340 return gfx::Size(kDialogWidth, height);
341 } 341 }
342 342
343 base::string16 CreateApplicationShortcutView::GetDialogButtonLabel( 343 base::string16 CreateApplicationShortcutView::GetDialogButtonLabel(
344 ui::DialogButton button) const { 344 ui::DialogButton button) const {
345 if (button == ui::DIALOG_BUTTON_OK) 345 if (button == ui::DIALOG_BUTTON_OK)
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 } 554 }
555 555
556 // Called when the app's ShortcutInfo (with icon) is loaded. 556 // Called when the app's ShortcutInfo (with icon) is loaded.
557 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded( 557 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded(
558 const web_app::ShortcutInfo& shortcut_info) { 558 const web_app::ShortcutInfo& shortcut_info) {
559 shortcut_info_ = shortcut_info; 559 shortcut_info_ = shortcut_info;
560 560
561 CHECK(app_info_); 561 CHECK(app_info_);
562 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); 562 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon);
563 } 563 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/create_application_shortcut_view.h ('k') | chrome/browser/ui/views/desktop_media_picker_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698