OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "chrome/browser/chromeos/cros/network_library.h" | 13 #include "chrome/browser/chromeos/cros/network_library.h" |
| 14 #include "chrome/browser/chromeos/cros/network_ui_data.h" |
14 #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow | 15 #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow |
15 #include "ui/views/controls/button/button.h" // views::ButtonListener | 16 #include "ui/views/controls/button/button.h" // views::ButtonListener |
16 #include "ui/views/window/dialog_delegate.h" | 17 #include "ui/views/window/dialog_delegate.h" |
17 | 18 |
18 namespace views { | 19 namespace views { |
| 20 class ImageView; |
19 class NativeTextButton; | 21 class NativeTextButton; |
20 class View; | 22 class View; |
21 } | 23 } |
22 | 24 |
23 namespace chromeos { | 25 namespace chromeos { |
24 | 26 |
25 class ChildNetworkConfigView; | 27 class ChildNetworkConfigView; |
26 | 28 |
27 // A dialog box for showing a password textfield. | 29 // A dialog box for showing a password textfield. |
28 class NetworkConfigView : public views::DialogDelegateView, | 30 class NetworkConfigView : public views::DialogDelegateView, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 static const int kInputFieldMinWidth; | 134 static const int kInputFieldMinWidth; |
133 | 135 |
134 protected: | 136 protected: |
135 std::string service_path_; | 137 std::string service_path_; |
136 NetworkConfigView* parent_; | 138 NetworkConfigView* parent_; |
137 | 139 |
138 private: | 140 private: |
139 DISALLOW_COPY_AND_ASSIGN(ChildNetworkConfigView); | 141 DISALLOW_COPY_AND_ASSIGN(ChildNetworkConfigView); |
140 }; | 142 }; |
141 | 143 |
| 144 // Shows an icon with tooltip indicating whether a setting is under policy |
| 145 // control. |
| 146 class ControlledSettingIndicatorView : public views::View { |
| 147 public: |
| 148 ControlledSettingIndicatorView(); |
| 149 explicit ControlledSettingIndicatorView(const NetworkPropertyUIData& ui_data); |
| 150 virtual ~ControlledSettingIndicatorView(); |
| 151 |
| 152 // Updates the view based on |ui_data|. |
| 153 void Update(const NetworkPropertyUIData& ui_data); |
| 154 |
| 155 protected: |
| 156 // views::View: |
| 157 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 158 virtual bool IsVisible() const OVERRIDE; |
| 159 virtual void Layout() OVERRIDE; |
| 160 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; |
| 161 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; |
| 162 |
| 163 private: |
| 164 // Initializes the view. |
| 165 void Init(); |
| 166 |
| 167 bool managed_; |
| 168 views::ImageView* image_view_; |
| 169 const SkBitmap* gray_image_; |
| 170 const SkBitmap* color_image_; |
| 171 |
| 172 DISALLOW_COPY_AND_ASSIGN(ControlledSettingIndicatorView); |
| 173 }; |
| 174 |
142 } // namespace chromeos | 175 } // namespace chromeos |
143 | 176 |
144 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ | 177 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ |
OLD | NEW |