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

Side by Side Diff: chrome/browser/chromeos/enrollment_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/chromeos/enrollment_dialog_view.h" 5 #include "chrome/browser/chromeos/enrollment_dialog_view.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/profiles/profile_manager.h" 10 #include "chrome/browser/profiles/profile_manager.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 virtual bool Accept() OVERRIDE; 50 virtual bool Accept() OVERRIDE;
51 virtual void OnClosed() OVERRIDE; 51 virtual void OnClosed() OVERRIDE;
52 virtual base::string16 GetDialogButtonLabel( 52 virtual base::string16 GetDialogButtonLabel(
53 ui::DialogButton button) const OVERRIDE; 53 ui::DialogButton button) const OVERRIDE;
54 54
55 // views::WidgetDelegate overrides 55 // views::WidgetDelegate overrides
56 virtual ui::ModalType GetModalType() const OVERRIDE; 56 virtual ui::ModalType GetModalType() const OVERRIDE;
57 virtual base::string16 GetWindowTitle() const OVERRIDE; 57 virtual base::string16 GetWindowTitle() const OVERRIDE;
58 58
59 // views::View overrides 59 // views::View overrides
60 virtual gfx::Size GetPreferredSize() OVERRIDE; 60 virtual gfx::Size GetPreferredSize() const OVERRIDE;
61 61
62 private: 62 private:
63 EnrollmentDialogView(const std::string& network_name, 63 EnrollmentDialogView(const std::string& network_name,
64 Profile* profile, 64 Profile* profile,
65 const GURL& target_uri, 65 const GURL& target_uri,
66 const base::Closure& connect); 66 const base::Closure& connect);
67 void InitDialog(); 67 void InitDialog();
68 68
69 bool accepted_; 69 bool accepted_;
70 std::string network_name_; 70 std::string network_name_;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 ui::ModalType EnrollmentDialogView::GetModalType() const { 137 ui::ModalType EnrollmentDialogView::GetModalType() const {
138 return ui::MODAL_TYPE_SYSTEM; 138 return ui::MODAL_TYPE_SYSTEM;
139 } 139 }
140 140
141 base::string16 EnrollmentDialogView::GetWindowTitle() const { 141 base::string16 EnrollmentDialogView::GetWindowTitle() const {
142 return l10n_util::GetStringUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_TITLE); 142 return l10n_util::GetStringUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_TITLE);
143 } 143 }
144 144
145 gfx::Size EnrollmentDialogView::GetPreferredSize() { 145 gfx::Size EnrollmentDialogView::GetPreferredSize() const {
146 return gfx::Size(kDefaultWidth, kDefaultHeight); 146 return gfx::Size(kDefaultWidth, kDefaultHeight);
147 } 147 }
148 148
149 void EnrollmentDialogView::InitDialog() { 149 void EnrollmentDialogView::InitDialog() {
150 added_cert_ = false; 150 added_cert_ = false;
151 // Create the views and layout manager and set them up. 151 // Create the views and layout manager and set them up.
152 views::Label* label = new views::Label( 152 views::Label* label = new views::Label(
153 l10n_util::GetStringFUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_INSTRUCTIONS, 153 l10n_util::GetStringFUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_INSTRUCTIONS,
154 base::UTF8ToUTF16(network_name_))); 154 base::UTF8ToUTF16(network_name_)));
155 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 155 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 ProfileManager::GetPrimaryUserProfile(); 287 ProfileManager::GetPrimaryUserProfile();
288 DialogEnrollmentDelegate* enrollment = 288 DialogEnrollmentDelegate* enrollment =
289 new DialogEnrollmentDelegate(owning_window, network->name(), profile); 289 new DialogEnrollmentDelegate(owning_window, network->name(), profile);
290 return enrollment->Enroll(certificate_pattern.enrollment_uri_list(), 290 return enrollment->Enroll(certificate_pattern.enrollment_uri_list(),
291 base::Bind(&EnrollmentComplete, service_path)); 291 base::Bind(&EnrollmentComplete, service_path));
292 } 292 }
293 293
294 } // namespace enrollment 294 } // namespace enrollment
295 295
296 } // namespace chromeos 296 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698