Home | History | Annotate | Download | only in options
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_OPTIONS_MANAGED_BANNER_HANDLER_H_
      6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_OPTIONS_MANAGED_BANNER_HANDLER_H_
      7 #pragma once
      8 
      9 #include "base/string16.h"
     10 #include "chrome/browser/policy/managed_prefs_banner_base.h"
     11 #include "chrome/browser/ui/options/options_window.h"
     12 
     13 class WebUI;
     14 
     15 // Managed options banner handler.
     16 // Controls the display of a banner if an options panel contains options
     17 // that are under administator control.
     18 class OptionsManagedBannerHandler : public policy::ManagedPrefsBannerBase {
     19  public:
     20   OptionsManagedBannerHandler(WebUI* web_ui, const string16& page_name,
     21                               OptionsPage page);
     22   virtual ~OptionsManagedBannerHandler();
     23 
     24  protected:
     25   // ManagedPrefsBannerBase implementation.
     26   virtual void OnUpdateVisibility();
     27 
     28  private:
     29   // Set the managed options banner to be visible or invisible.
     30   void SetupBannerVisibility();
     31 
     32   WebUI* web_ui_;  // weak reference to the WebUI.
     33   string16 page_name_;  // current options page name.
     34   OptionsPage page_;  // current options page value.
     35 
     36   DISALLOW_COPY_AND_ASSIGN(OptionsManagedBannerHandler);
     37 };
     38 
     39 #endif  // CHROME_BROWSER_UI_WEBUI_OPTIONS_OPTIONS_MANAGED_BANNER_HANDLER_H_
     40