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_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 } | 40 } |
41 | 41 |
42 // A dialog box to allow configuration of VPN connection. | 42 // A dialog box to allow configuration of VPN connection. |
43 class VPNConfigView : public ChildNetworkConfigView, | 43 class VPNConfigView : public ChildNetworkConfigView, |
44 public views::TextfieldController, | 44 public views::TextfieldController, |
45 public views::ButtonListener, | 45 public views::ButtonListener, |
46 public views::ComboboxListener, | 46 public views::ComboboxListener, |
47 public CertLibrary::Observer { | 47 public CertLibrary::Observer { |
48 public: | 48 public: |
49 VPNConfigView(NetworkConfigView* parent, const std::string& service_path); | 49 VPNConfigView(NetworkConfigView* parent, const std::string& service_path); |
50 virtual ~VPNConfigView(); | 50 ~VPNConfigView() override; |
51 | 51 |
52 // views::TextfieldController: | 52 // views::TextfieldController: |
53 virtual void ContentsChanged(views::Textfield* sender, | 53 void ContentsChanged(views::Textfield* sender, |
54 const base::string16& new_contents) override; | 54 const base::string16& new_contents) override; |
55 virtual bool HandleKeyEvent(views::Textfield* sender, | 55 bool HandleKeyEvent(views::Textfield* sender, |
56 const ui::KeyEvent& key_event) override; | 56 const ui::KeyEvent& key_event) override; |
57 | 57 |
58 // views::ButtonListener: | 58 // views::ButtonListener: |
59 virtual void ButtonPressed(views::Button* sender, | 59 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
60 const ui::Event& event) override; | |
61 | 60 |
62 // views::ComboboxListener: | 61 // views::ComboboxListener: |
63 virtual void OnPerformAction(views::Combobox* combobox) override; | 62 void OnPerformAction(views::Combobox* combobox) override; |
64 | 63 |
65 // CertLibrary::Observer: | 64 // CertLibrary::Observer: |
66 virtual void OnCertificatesLoaded(bool initial_load) override; | 65 void OnCertificatesLoaded(bool initial_load) override; |
67 | 66 |
68 // ChildNetworkConfigView: | 67 // ChildNetworkConfigView: |
69 virtual base::string16 GetTitle() const override; | 68 base::string16 GetTitle() const override; |
70 virtual views::View* GetInitiallyFocusedView() override; | 69 views::View* GetInitiallyFocusedView() override; |
71 virtual bool CanLogin() override; | 70 bool CanLogin() override; |
72 virtual bool Login() override; | 71 bool Login() override; |
73 virtual void Cancel() override; | 72 void Cancel() override; |
74 virtual void InitFocus() override; | 73 void InitFocus() override; |
75 | 74 |
76 private: | 75 private: |
77 // Initializes data members and create UI controls. | 76 // Initializes data members and create UI controls. |
78 void Init(); | 77 void Init(); |
79 | 78 |
80 // Callback to initialize fields from uncached network properties. | 79 // Callback to initialize fields from uncached network properties. |
81 void InitFromProperties(const std::string& service_path, | 80 void InitFromProperties(const std::string& service_path, |
82 const base::DictionaryValue& dictionary); | 81 const base::DictionaryValue& dictionary); |
83 void ParseUIProperties(const NetworkState* vpn); | 82 void ParseUIProperties(const NetworkState* vpn); |
84 void GetPropertiesError(const std::string& error_name, | 83 void GetPropertiesError(const std::string& error_name, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 std::string client_cert_id_; | 188 std::string client_cert_id_; |
190 | 189 |
191 base::WeakPtrFactory<VPNConfigView> weak_ptr_factory_; | 190 base::WeakPtrFactory<VPNConfigView> weak_ptr_factory_; |
192 | 191 |
193 DISALLOW_COPY_AND_ASSIGN(VPNConfigView); | 192 DISALLOW_COPY_AND_ASSIGN(VPNConfigView); |
194 }; | 193 }; |
195 | 194 |
196 } // namespace chromeos | 195 } // namespace chromeos |
197 | 196 |
198 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ | 197 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ |
OLD | NEW |