OLD | NEW |
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 #ifndef CHROME_BROWSER_UI_VIEWS_CRYPTO_MODULE_PASSWORD_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_CRYPTO_MODULE_PASSWORD_DIALOG_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_CRYPTO_MODULE_PASSWORD_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_CRYPTO_MODULE_PASSWORD_DIALOG_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace chrome { | 21 namespace chrome { |
22 | 22 |
23 class CryptoModulePasswordDialogView : public views::DialogDelegateView, | 23 class CryptoModulePasswordDialogView : public views::DialogDelegateView, |
24 public views::TextfieldController { | 24 public views::TextfieldController { |
25 public: | 25 public: |
26 CryptoModulePasswordDialogView(const std::string& slot_name, | 26 CryptoModulePasswordDialogView(const std::string& slot_name, |
27 CryptoModulePasswordReason reason, | 27 CryptoModulePasswordReason reason, |
28 const std::string& server, | 28 const std::string& server, |
29 const CryptoModulePasswordCallback& callback); | 29 const CryptoModulePasswordCallback& callback); |
30 | 30 |
31 virtual ~CryptoModulePasswordDialogView(); | 31 ~CryptoModulePasswordDialogView() override; |
32 | 32 |
33 private: | 33 private: |
34 FRIEND_TEST_ALL_PREFIXES(CryptoModulePasswordDialogViewTest, TestAccept); | 34 FRIEND_TEST_ALL_PREFIXES(CryptoModulePasswordDialogViewTest, TestAccept); |
35 | 35 |
36 // views::WidgetDelegate: | 36 // views::WidgetDelegate: |
37 virtual views::View* GetInitiallyFocusedView() override; | 37 views::View* GetInitiallyFocusedView() override; |
38 virtual ui::ModalType GetModalType() const override; | 38 ui::ModalType GetModalType() const override; |
39 virtual base::string16 GetWindowTitle() const override; | 39 base::string16 GetWindowTitle() const override; |
40 | 40 |
41 // views::DialogDelegate: | 41 // views::DialogDelegate: |
42 virtual base::string16 GetDialogButtonLabel( | 42 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
43 ui::DialogButton button) const override; | 43 bool Cancel() override; |
44 virtual bool Cancel() override; | 44 bool Accept() override; |
45 virtual bool Accept() override; | |
46 | 45 |
47 // views::TextfieldController: | 46 // views::TextfieldController: |
48 virtual void ContentsChanged(views::Textfield* sender, | 47 void ContentsChanged(views::Textfield* sender, |
49 const base::string16& new_contents) override; | 48 const base::string16& new_contents) override; |
50 virtual bool HandleKeyEvent(views::Textfield* sender, | 49 bool HandleKeyEvent(views::Textfield* sender, |
51 const ui::KeyEvent& keystroke) override; | 50 const ui::KeyEvent& keystroke) override; |
52 | 51 |
53 // Initialize views and layout. | 52 // Initialize views and layout. |
54 void Init(const std::string& server, | 53 void Init(const std::string& server, |
55 const std::string& slot_name, | 54 const std::string& slot_name, |
56 CryptoModulePasswordReason reason); | 55 CryptoModulePasswordReason reason); |
57 | 56 |
58 views::Label* reason_label_; | 57 views::Label* reason_label_; |
59 views::Label* password_label_; | 58 views::Label* password_label_; |
60 views::Textfield* password_entry_; | 59 views::Textfield* password_entry_; |
61 | 60 |
62 const CryptoModulePasswordCallback callback_; | 61 const CryptoModulePasswordCallback callback_; |
63 | 62 |
64 DISALLOW_COPY_AND_ASSIGN(CryptoModulePasswordDialogView); | 63 DISALLOW_COPY_AND_ASSIGN(CryptoModulePasswordDialogView); |
65 }; | 64 }; |
66 | 65 |
67 } // namespace chrome | 66 } // namespace chrome |
68 | 67 |
69 #endif // CHROME_BROWSER_UI_VIEWS_CRYPTO_MODULE_PASSWORD_DIALOG_VIEW_H_ | 68 #endif // CHROME_BROWSER_UI_VIEWS_CRYPTO_MODULE_PASSWORD_DIALOG_VIEW_H_ |
OLD | NEW |