Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / chromeos / options / passphrase_textfield.h
blob03135fe31adf43be9943e0045d00346ac5954cb1
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_PASSPHRASE_TEXTFIELD_H_
6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_PASSPHRASE_TEXTFIELD_H_
8 #include <string>
10 #include "ui/views/controls/textfield/textfield.h"
12 namespace chromeos {
14 class PassphraseTextfield : public views::Textfield {
15 public:
16 PassphraseTextfield();
18 // If show_fake is true, then the text field will show a fake password.
19 void SetShowFake(bool show_fake);
21 // Override views::Textfield so that when focus is gained, then clear out the
22 // fake password if appropriate. Replace it when focus is lost if the user has
23 // not typed in a new password.
24 void OnFocus() override;
25 void OnBlur() override;
27 // Returns the passphrase. If it's unchanged, then returns an empty string.
28 std::string GetPassphrase();
30 bool changed() const { return changed_; }
31 bool show_fake() const { return show_fake_; }
33 private:
34 void SetFakePassphrase();
35 void ClearFakePassphrase();
37 bool show_fake_;
38 bool changed_;
41 } // namespace chromeos
43 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_PASSPHRASE_TEXTFIELD_H_