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

Side by Side Diff: chrome/browser/ui/views/importer/import_lock_dialog_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/importer/import_lock_dialog_view.h" 5 #include "chrome/browser/ui/views/importer/import_lock_dialog_view.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/importer/importer_lock_dialog.h" 10 #include "chrome/browser/importer/importer_lock_dialog.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 description_label_ = new views::Label( 43 description_label_ = new views::Label(
44 l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_TEXT)); 44 l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_TEXT));
45 description_label_->SetMultiLine(true); 45 description_label_->SetMultiLine(true);
46 description_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 46 description_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
47 AddChildView(description_label_); 47 AddChildView(description_label_);
48 } 48 }
49 49
50 ImportLockDialogView::~ImportLockDialogView() { 50 ImportLockDialogView::~ImportLockDialogView() {
51 } 51 }
52 52
53 gfx::Size ImportLockDialogView::GetPreferredSize() { 53 gfx::Size ImportLockDialogView::GetPreferredSize() const {
54 return gfx::Size(views::Widget::GetLocalizedContentsSize( 54 return gfx::Size(views::Widget::GetLocalizedContentsSize(
55 IDS_IMPORTLOCK_DIALOG_WIDTH_CHARS, 55 IDS_IMPORTLOCK_DIALOG_WIDTH_CHARS,
56 IDS_IMPORTLOCK_DIALOG_HEIGHT_LINES)); 56 IDS_IMPORTLOCK_DIALOG_HEIGHT_LINES));
57 } 57 }
58 58
59 void ImportLockDialogView::Layout() { 59 void ImportLockDialogView::Layout() {
60 gfx::Rect bounds(GetLocalBounds()); 60 gfx::Rect bounds(GetLocalBounds());
61 bounds.Inset(views::kButtonHEdgeMargin, views::kPanelVertMargin); 61 bounds.Inset(views::kButtonHEdgeMargin, views::kPanelVertMargin);
62 description_label_->SetBoundsRect(bounds); 62 description_label_->SetBoundsRect(bounds);
63 } 63 }
(...skipping 12 matching lines...) Expand all
76 base::MessageLoop::current()->PostTask(FROM_HERE, 76 base::MessageLoop::current()->PostTask(FROM_HERE,
77 base::Bind(callback_, true)); 77 base::Bind(callback_, true));
78 return true; 78 return true;
79 } 79 }
80 80
81 bool ImportLockDialogView::Cancel() { 81 bool ImportLockDialogView::Cancel() {
82 base::MessageLoop::current()->PostTask(FROM_HERE, 82 base::MessageLoop::current()->PostTask(FROM_HERE,
83 base::Bind(callback_, false)); 83 base::Bind(callback_, false));
84 return true; 84 return true;
85 } 85 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/importer/import_lock_dialog_view.h ('k') | chrome/browser/ui/views/infobars/after_translate_infobar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698