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

Side by Side Diff: chrome/browser/chromeos/enrollment_dialog_view.cc

Issue 11571023: Move ash/wm's DialogFrameView to ui/views/window; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reorder DialogDelegate functions; inline Get*Params into WidgetExample::ButtonPressed; etc. Created 8 years 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
« no previous file with comments | « ash/wm/dialog_frame_view.cc ('k') | chrome/browser/chromeos/login/password_changed_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/chromeos/cros/network_library.h" 9 #include "chrome/browser/chromeos/cros/network_library.h"
10 #include "chrome/browser/extensions/extension_host.h" 10 #include "chrome/browser/extensions/extension_host.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 virtual bool Accept() OVERRIDE; 48 virtual bool Accept() OVERRIDE;
49 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; 49 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
50 50
51 // views::WidgetDelegate overrides 51 // views::WidgetDelegate overrides
52 virtual ui::ModalType GetModalType() const OVERRIDE; 52 virtual ui::ModalType GetModalType() const OVERRIDE;
53 virtual string16 GetWindowTitle() const OVERRIDE; 53 virtual string16 GetWindowTitle() const OVERRIDE;
54 54
55 // views::View overrides 55 // views::View overrides
56 virtual gfx::Size GetPreferredSize() OVERRIDE; 56 virtual gfx::Size GetPreferredSize() OVERRIDE;
57 57
58 // views::Widget overrides
59 virtual views::View* GetContentsView() OVERRIDE;
60
61 private: 58 private:
62 EnrollmentDialogView(const std::string& network_name, 59 EnrollmentDialogView(const std::string& network_name,
63 Profile* profile, 60 Profile* profile,
64 const GURL& target_uri, 61 const GURL& target_uri,
65 const base::Closure& connect); 62 const base::Closure& connect);
66 void InitDialog(); 63 void InitDialog();
67 64
68 std::string network_name_; 65 std::string network_name_;
69 Profile* profile_; 66 Profile* profile_;
70 GURL target_uri_; 67 GURL target_uri_;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 135 }
139 136
140 string16 EnrollmentDialogView::GetWindowTitle() const { 137 string16 EnrollmentDialogView::GetWindowTitle() const {
141 return l10n_util::GetStringUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_TITLE); 138 return l10n_util::GetStringUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_TITLE);
142 } 139 }
143 140
144 gfx::Size EnrollmentDialogView::GetPreferredSize() { 141 gfx::Size EnrollmentDialogView::GetPreferredSize() {
145 return gfx::Size(kDefaultWidth, kDefaultHeight); 142 return gfx::Size(kDefaultWidth, kDefaultHeight);
146 } 143 }
147 144
148 views::View* EnrollmentDialogView::GetContentsView() {
149 return this;
150 }
151
152 void EnrollmentDialogView::InitDialog() { 145 void EnrollmentDialogView::InitDialog() {
153 added_cert_ = false; 146 added_cert_ = false;
154 // Create the views and layout manager and set them up. 147 // Create the views and layout manager and set them up.
155 views::Label* label = new views::Label( 148 views::Label* label = new views::Label(
156 l10n_util::GetStringFUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_INSTRUCTIONS, 149 l10n_util::GetStringFUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_INSTRUCTIONS,
157 UTF8ToUTF16(network_name_))); 150 UTF8ToUTF16(network_name_)));
158 label->SetFont(ui::ResourceBundle::GetSharedInstance().GetFont( 151 label->SetFont(ui::ResourceBundle::GetSharedInstance().GetFont(
159 ui::ResourceBundle::BaseFont)); 152 ui::ResourceBundle::BaseFont));
160 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 153 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
161 label->SetMultiLine(true); 154 label->SetMultiLine(true);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 //////////////////////////////////////////////////////////////////////////////// 246 ////////////////////////////////////////////////////////////////////////////////
254 // Factory function. 247 // Factory function.
255 248
256 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window, 249 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window,
257 const std::string& network_name, 250 const std::string& network_name,
258 Profile* profile) { 251 Profile* profile) {
259 return new DialogEnrollmentDelegate(owning_window, network_name, profile); 252 return new DialogEnrollmentDelegate(owning_window, network_name, profile);
260 } 253 }
261 254
262 } // namespace chromeos 255 } // namespace chromeos
OLDNEW
« no previous file with comments | « ash/wm/dialog_frame_view.cc ('k') | chrome/browser/chromeos/login/password_changed_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698