| 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_NETWORK_CONFIG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // Called when dialog "Cancel" button is pressed. | 40 // Called when dialog "Cancel" button is pressed. |
| 41 virtual void OnDialogCancelled() = 0; | 41 virtual void OnDialogCancelled() = 0; |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 virtual ~Delegate() {} | 44 virtual ~Delegate() {} |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 // Shows a network connection dialog if none is currently visible. | 47 // Shows a network connection dialog if none is currently visible. |
| 48 static void Show(const std::string& service_path, gfx::NativeWindow parent); | 48 static void Show(const std::string& service_path, gfx::NativeWindow parent); |
| 49 |
| 50 // Same as above but takes a network id (GUID) instead. |
| 51 static void ShowByNetworkId(const std::string& network_id, |
| 52 gfx::NativeWindow parent); |
| 53 |
| 49 // Shows a dialog to configure a new network. |type| must be a valid Shill | 54 // Shows a dialog to configure a new network. |type| must be a valid Shill |
| 50 // 'Type' property value. | 55 // 'Type' property value. |
| 51 static void ShowForType(const std::string& type, gfx::NativeWindow parent); | 56 static void ShowForType(const std::string& type, gfx::NativeWindow parent); |
| 52 | 57 |
| 53 // Returns corresponding native window. | 58 // Returns corresponding native window. |
| 54 gfx::NativeWindow GetNativeWindow() const; | 59 gfx::NativeWindow GetNativeWindow() const; |
| 55 | 60 |
| 56 // views::DialogDelegate methods. | 61 // views::DialogDelegate methods. |
| 57 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 62 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| 58 bool IsDialogButtonEnabled(ui::DialogButton button) const override; | 63 bool IsDialogButtonEnabled(ui::DialogButton button) const override; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 79 // views::View overrides: | 84 // views::View overrides: |
| 80 void Layout() override; | 85 void Layout() override; |
| 81 gfx::Size GetPreferredSize() const override; | 86 gfx::Size GetPreferredSize() const override; |
| 82 void ViewHierarchyChanged( | 87 void ViewHierarchyChanged( |
| 83 const ViewHierarchyChangedDetails& details) override; | 88 const ViewHierarchyChangedDetails& details) override; |
| 84 | 89 |
| 85 private: | 90 private: |
| 86 NetworkConfigView(); | 91 NetworkConfigView(); |
| 87 ~NetworkConfigView() override; | 92 ~NetworkConfigView() override; |
| 88 | 93 |
| 94 static void ShowByNetwork(const NetworkState* network, |
| 95 gfx::NativeWindow parent); |
| 96 |
| 89 // Login dialog for known networks. Returns true if successfully created. | 97 // Login dialog for known networks. Returns true if successfully created. |
| 90 bool InitWithNetworkState(const NetworkState* network); | 98 bool InitWithNetworkState(const NetworkState* network); |
| 91 // Login dialog for new/hidden networks. Returns true if successfully created. | 99 // Login dialog for new/hidden networks. Returns true if successfully created. |
| 92 bool InitWithType(const std::string& type); | 100 bool InitWithType(const std::string& type); |
| 93 | 101 |
| 94 // Creates and shows a dialog containing this view. | 102 // Creates and shows a dialog containing this view. |
| 95 void ShowDialog(gfx::NativeWindow parent); | 103 void ShowDialog(gfx::NativeWindow parent); |
| 96 | 104 |
| 97 // Resets the underlying view to show advanced options. | 105 // Resets the underlying view to show advanced options. |
| 98 void ShowAdvancedView(); | 106 void ShowAdvancedView(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 private: | 178 private: |
| 171 bool managed_; | 179 bool managed_; |
| 172 views::ImageView* image_view_; | 180 views::ImageView* image_view_; |
| 173 | 181 |
| 174 DISALLOW_COPY_AND_ASSIGN(ControlledSettingIndicatorView); | 182 DISALLOW_COPY_AND_ASSIGN(ControlledSettingIndicatorView); |
| 175 }; | 183 }; |
| 176 | 184 |
| 177 } // namespace chromeos | 185 } // namespace chromeos |
| 178 | 186 |
| 179 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ | 187 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ |
| OLD | NEW |