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

Side by Side Diff: chrome/browser/chromeos/options/passphrase_textfield.cc

Issue 21046008: Convert all connect code to use NetworkHandler instead of NetworkLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Round 2.1 Created 7 years, 4 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/options/passphrase_textfield.h" 5 #include "chrome/browser/chromeos/options/passphrase_textfield.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 8
9 namespace chromeos { 9 namespace chromeos {
10 10
11 PassphraseTextfield::PassphraseTextfield(bool show_fake) 11 PassphraseTextfield::PassphraseTextfield()
12 : Textfield(views::Textfield::STYLE_OBSCURED), 12 : Textfield(views::Textfield::STYLE_OBSCURED),
13 show_fake_(show_fake), 13 show_fake_(false),
14 changed_(true) { 14 changed_(true) {
15 }
16
17 void PassphraseTextfield::SetShowFake(bool show_fake) {
18 show_fake_ = show_fake;
15 if (show_fake_) 19 if (show_fake_)
16 SetFakePassphrase(); 20 SetFakePassphrase();
21 else
22 ClearFakePassphrase();
17 } 23 }
18 24
19 void PassphraseTextfield::OnFocus() { 25 void PassphraseTextfield::OnFocus() {
20 // If showing the fake password, then clear it when focused. 26 // If showing the fake password, then clear it when focused.
21 if (show_fake_ && !changed_) 27 if (show_fake_ && !changed_)
22 ClearFakePassphrase(); 28 ClearFakePassphrase();
23 Textfield::OnFocus(); 29 Textfield::OnFocus();
24 } 30 }
25 31
26 void PassphraseTextfield::OnBlur() { 32 void PassphraseTextfield::OnBlur() {
(...skipping 12 matching lines...) Expand all
39 SetText(fake_passphrase); 45 SetText(fake_passphrase);
40 changed_ = false; 46 changed_ = false;
41 } 47 }
42 48
43 void PassphraseTextfield::ClearFakePassphrase() { 49 void PassphraseTextfield::ClearFakePassphrase() {
44 SetText(string16()); 50 SetText(string16());
45 changed_ = true; 51 changed_ = true;
46 } 52 }
47 53
48 } // namespace chromeos 54 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698