OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_VIEWS_OPTIONS_MANAGED_PREFS_BANNER_VIEW_H_ | |
6 #define CHROME_BROWSER_UI_VIEWS_OPTIONS_MANAGED_PREFS_BANNER_VIEW_H_ | |
7 #pragma once | |
8 | |
9 #include "chrome/browser/policy/managed_prefs_banner_base.h" | |
10 #include "views/view.h" | |
11 | |
12 namespace views { | |
13 class ImageView; | |
14 class Label; | |
15 } | |
16 | |
17 // Displays a banner showing a warning message that tells the user some options | |
18 // cannot be changed because the relevant preferences are managed by their | |
19 // system administrator. | |
20 class ManagedPrefsBannerView : public policy::ManagedPrefsBannerBase, | |
21 public views::View { | |
22 public: | |
23 // Initialize the banner. |page| is used to determine the names of the | |
24 // preferences that control the banner visibility through their managed flag. | |
25 ManagedPrefsBannerView(PrefService* pref_service, OptionsPage page); | |
26 virtual ~ManagedPrefsBannerView() {} | |
27 | |
28 private: | |
29 // Initialize contents and layout. | |
30 void Init(); | |
31 | |
32 // views::View overrides. | |
33 virtual gfx::Size GetPreferredSize(); | |
34 virtual void Layout(); | |
35 virtual void ViewHierarchyChanged(bool is_add, | |
36 views::View* parent, | |
37 views::View* child); | |
38 | |
39 // ManagedPrefsBannerBase override. | |
40 virtual void OnUpdateVisibility(); | |
41 | |
42 // Holds the warning icon image and text label and renders the border. | |
43 views::View* content_; | |
44 // Warning icon image. | |
45 views::ImageView* warning_image_; | |
46 // The label responsible for rendering the warning text. | |
47 views::Label* label_; | |
48 | |
49 DISALLOW_IMPLICIT_CONSTRUCTORS(ManagedPrefsBannerView); | |
50 }; | |
51 | |
52 #endif // CHROME_BROWSER_UI_VIEWS_OPTIONS_MANAGED_PREFS_BANNER_VIEW_H_ | |
OLD | NEW |