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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 gfx::NativeWindow parent); | 51 gfx::NativeWindow parent); |
52 | 52 |
53 // Same as above but places the dialog in the given container on the primary | 53 // Same as above but places the dialog in the given container on the primary |
54 // display. Used as a fallback when no parent is available. | 54 // display. Used as a fallback when no parent is available. |
55 static void ShowInContainer(const std::string& network_id, int container_id); | 55 static void ShowInContainer(const std::string& network_id, int container_id); |
56 | 56 |
57 // 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 |
58 // 'Type' property value. | 58 // 'Type' property value. |
59 static void ShowForType(const std::string& type, gfx::NativeWindow parent); | 59 static void ShowForType(const std::string& type, gfx::NativeWindow parent); |
60 | 60 |
| 61 // As above but places the dialog in the given ash window container on the |
| 62 // primary display. Used as a fallback when no parent is available. |
| 63 static void ShowForTypeInContainer(const std::string& type, int container_id); |
| 64 |
61 // Returns corresponding native window. | 65 // Returns corresponding native window. |
62 gfx::NativeWindow GetNativeWindow() const; | 66 gfx::NativeWindow GetNativeWindow() const; |
63 | 67 |
64 // views::DialogDelegate methods. | 68 // views::DialogDelegate methods. |
65 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 69 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
66 bool IsDialogButtonEnabled(ui::DialogButton button) const override; | 70 bool IsDialogButtonEnabled(ui::DialogButton button) const override; |
67 bool Cancel() override; | 71 bool Cancel() override; |
68 bool Accept() override; | 72 bool Accept() override; |
69 views::View* CreateExtraView() override; | 73 views::View* CreateExtraView() override; |
70 views::View* GetInitiallyFocusedView() override; | 74 views::View* GetInitiallyFocusedView() override; |
(...skipping 16 matching lines...) Expand all Loading... |
87 // views::View overrides: | 91 // views::View overrides: |
88 void Layout() override; | 92 void Layout() override; |
89 gfx::Size GetPreferredSize() const override; | 93 gfx::Size GetPreferredSize() const override; |
90 void ViewHierarchyChanged( | 94 void ViewHierarchyChanged( |
91 const ViewHierarchyChangedDetails& details) override; | 95 const ViewHierarchyChangedDetails& details) override; |
92 | 96 |
93 private: | 97 private: |
94 NetworkConfigView(); | 98 NetworkConfigView(); |
95 ~NetworkConfigView() override; | 99 ~NetworkConfigView() override; |
96 | 100 |
97 static void ShowImpl(const std::string& network_id, | 101 // Returns null for invalid network or if dialog is already showing. |
98 gfx::NativeWindow parent, | 102 static NetworkConfigView* CreateForNetworkId(const std::string& network_id); |
99 int container_id); | 103 |
| 104 // Returns null for invalid network type or if dialog is already showing. |
| 105 static NetworkConfigView* CreateForType(const std::string& type); |
100 | 106 |
101 // Login dialog for known networks. Returns true if successfully created. | 107 // Login dialog for known networks. Returns true if successfully created. |
102 bool InitWithNetworkState(const NetworkState* network); | 108 bool InitWithNetworkState(const NetworkState* network); |
103 // Login dialog for new/hidden networks. Returns true if successfully created. | 109 // Login dialog for new/hidden networks. Returns true if successfully created. |
104 bool InitWithType(const std::string& type); | 110 bool InitWithType(const std::string& type); |
105 | 111 |
106 // Creates and shows a dialog containing this view. | 112 // Creates and shows a dialog containing this view. |
107 void ShowDialog(gfx::NativeWindow parent); | 113 void ShowDialog(gfx::NativeWindow parent); |
108 void ShowDialogInContainer(int container_id); | 114 void ShowDialogInContainer(int container_id); |
109 | 115 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 private: | 189 private: |
184 bool managed_; | 190 bool managed_; |
185 views::ImageView* image_view_; | 191 views::ImageView* image_view_; |
186 | 192 |
187 DISALLOW_COPY_AND_ASSIGN(ControlledSettingIndicatorView); | 193 DISALLOW_COPY_AND_ASSIGN(ControlledSettingIndicatorView); |
188 }; | 194 }; |
189 | 195 |
190 } // namespace chromeos | 196 } // namespace chromeos |
191 | 197 |
192 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ | 198 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ |
OLD | NEW |