Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1292)

Side by Side Diff: chrome/browser/dom_ui/options_managed_banner_handler.cc

Issue 3108018: Display a banner above each panel that contains managed options.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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 #include "chrome/browser/dom_ui/options_managed_banner_handler.h"
6
7 #include "base/utf_string_conversions.h"
8 #include "base/values.h"
9 #include "chrome/browser/dom_ui/dom_ui.h"
10 #include "chrome/browser/profile.h"
11
12 OptionsManagedBannerHandler::OptionsManagedBannerHandler(
13 DOMUI* dom_ui, const string16& page_name, OptionsPage page)
14 : ManagedPrefsBannerBase(dom_ui->GetProfile()->GetPrefs(), page),
15 dom_ui_(dom_ui), page_name_(page_name), page_(page) {
16 // Initialize the visibility state of the banner.
17 SetupBannerVisibilty();
18 }
19
20 void OptionsManagedBannerHandler::OnUpdateVisibility() {
21 // A preference that may be managed has changed. Update our visibility
22 // state.
23 SetupBannerVisibilty();
24 }
25
26 void OptionsManagedBannerHandler::SetupBannerVisibilty() {
27 // Construct the banner visibility script name.
28 string16 script = ASCIIToUTF16("options.") + page_name_ +
29 ASCIIToUTF16(".getInstance().setManagedBannerVisibility");
30
31 // Get the visiblity value from the base class.
32 FundamentalValue visibility(DetermineVisibility());
33
34 // Set the managed state in the javascript handler.
35 dom_ui_->CallJavascriptFunction(UTF16ToWideHack(script), visibility);
36 }
37
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/options_managed_banner_handler.h ('k') | chrome/browser/dom_ui/personal_options_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698