| 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 26 matching lines...) Expand all Loading... |
| 37 // Called when dialog "OK" button is pressed. | 37 // Called when dialog "OK" button is pressed. |
| 38 virtual void OnDialogAccepted() = 0; | 38 virtual void OnDialogAccepted() = 0; |
| 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. The dialog |
| 48 static void Show(const std::string& service_path, gfx::NativeWindow parent); | 48 // will be a child of |parent| (e.g. the webui settings window) which ensures |
| 49 // it appears on the display the user is looking at. |
| 50 static void ShowInParent(const std::string& network_id, |
| 51 gfx::NativeWindow parent); |
| 49 | 52 |
| 50 // Same as above but takes a network id (GUID) instead. | 53 // Same as above but places the dialog in the given container on the primary |
| 51 static void ShowByNetworkId(const std::string& network_id, | 54 // display. Used as a fallback when no parent is available. |
| 52 gfx::NativeWindow parent); | 55 static void ShowInContainer(const std::string& network_id, int container_id); |
| 53 | 56 |
| 54 // Shows a dialog to configure a new network. |type| must be a valid Shill | 57 // Shows a dialog to configure a new network. |type| must be a valid Shill |
| 55 // 'Type' property value. | 58 // 'Type' property value. |
| 56 static void ShowForType(const std::string& type, gfx::NativeWindow parent); | 59 static void ShowForType(const std::string& type, gfx::NativeWindow parent); |
| 57 | 60 |
| 58 // Returns corresponding native window. | 61 // Returns corresponding native window. |
| 59 gfx::NativeWindow GetNativeWindow() const; | 62 gfx::NativeWindow GetNativeWindow() const; |
| 60 | 63 |
| 61 // views::DialogDelegate methods. | 64 // views::DialogDelegate methods. |
| 62 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 65 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 84 // views::View overrides: | 87 // views::View overrides: |
| 85 void Layout() override; | 88 void Layout() override; |
| 86 gfx::Size GetPreferredSize() const override; | 89 gfx::Size GetPreferredSize() const override; |
| 87 void ViewHierarchyChanged( | 90 void ViewHierarchyChanged( |
| 88 const ViewHierarchyChangedDetails& details) override; | 91 const ViewHierarchyChangedDetails& details) override; |
| 89 | 92 |
| 90 private: | 93 private: |
| 91 NetworkConfigView(); | 94 NetworkConfigView(); |
| 92 ~NetworkConfigView() override; | 95 ~NetworkConfigView() override; |
| 93 | 96 |
| 94 static void ShowByNetwork(const NetworkState* network, | 97 static void ShowImpl(const std::string& network_id, |
| 95 gfx::NativeWindow parent); | 98 gfx::NativeWindow parent, |
| 99 int container_id); |
| 96 | 100 |
| 97 // Login dialog for known networks. Returns true if successfully created. | 101 // Login dialog for known networks. Returns true if successfully created. |
| 98 bool InitWithNetworkState(const NetworkState* network); | 102 bool InitWithNetworkState(const NetworkState* network); |
| 99 // Login dialog for new/hidden networks. Returns true if successfully created. | 103 // Login dialog for new/hidden networks. Returns true if successfully created. |
| 100 bool InitWithType(const std::string& type); | 104 bool InitWithType(const std::string& type); |
| 101 | 105 |
| 102 // Creates and shows a dialog containing this view. | 106 // Creates and shows a dialog containing this view. |
| 103 void ShowDialog(gfx::NativeWindow parent); | 107 void ShowDialog(gfx::NativeWindow parent); |
| 108 void ShowDialogInContainer(int container_id); |
| 104 | 109 |
| 105 // Resets the underlying view to show advanced options. | 110 // Resets the underlying view to show advanced options. |
| 106 void ShowAdvancedView(); | 111 void ShowAdvancedView(); |
| 107 | 112 |
| 108 // There's always only one child view, which will get deleted when | 113 // There's always only one child view, which will get deleted when |
| 109 // NetworkConfigView gets cleaned up. | 114 // NetworkConfigView gets cleaned up. |
| 110 ChildNetworkConfigView* child_config_view_; | 115 ChildNetworkConfigView* child_config_view_; |
| 111 | 116 |
| 112 Delegate* delegate_; | 117 Delegate* delegate_; |
| 113 | 118 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 private: | 183 private: |
| 179 bool managed_; | 184 bool managed_; |
| 180 views::ImageView* image_view_; | 185 views::ImageView* image_view_; |
| 181 | 186 |
| 182 DISALLOW_COPY_AND_ASSIGN(ControlledSettingIndicatorView); | 187 DISALLOW_COPY_AND_ASSIGN(ControlledSettingIndicatorView); |
| 183 }; | 188 }; |
| 184 | 189 |
| 185 } // namespace chromeos | 190 } // namespace chromeos |
| 186 | 191 |
| 187 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ | 192 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ |
| OLD | NEW |