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

Side by Side Diff: chrome/browser/views/options/managed_prefs_banner_view.cc

Issue 3108029: Display an infobar when content settings were created. (Closed)
Patch Set: updates 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
« no previous file with comments | « chrome/browser/views/collected_cookies_win.cc ('k') | views/box_layout.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 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 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 #include "chrome/browser/views/options/managed_prefs_banner_view.h" 5 #include "chrome/browser/views/options/managed_prefs_banner_view.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "gfx/color_utils.h" 8 #include "gfx/color_utils.h"
9 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
10 #include "grit/theme_resources.h" 10 #include "grit/theme_resources.h"
(...skipping 20 matching lines...) Expand all
31 warning_image_ = new views::ImageView(); 31 warning_image_ = new views::ImageView();
32 warning_image_->SetImage(rb.GetBitmapNamed(IDR_WARNING)); 32 warning_image_->SetImage(rb.GetBitmapNamed(IDR_WARNING));
33 label_ = new views::Label(rb.GetLocalizedString(IDS_OPTIONS_MANAGED_PREFS)); 33 label_ = new views::Label(rb.GetLocalizedString(IDS_OPTIONS_MANAGED_PREFS));
34 } 34 }
35 35
36 void ManagedPrefsBannerView::Init() { 36 void ManagedPrefsBannerView::Init() {
37 AddChildView(content_); 37 AddChildView(content_);
38 content_->SetLayoutManager( 38 content_->SetLayoutManager(
39 new views::BoxLayout(views::BoxLayout::kHorizontal, 39 new views::BoxLayout(views::BoxLayout::kHorizontal,
40 kPrefsBannerPadding, 40 kPrefsBannerPadding,
41 kPrefsBannerPadding,
41 kRelatedControlSmallHorizontalSpacing)); 42 kRelatedControlSmallHorizontalSpacing));
42 content_->AddChildView(warning_image_); 43 content_->AddChildView(warning_image_);
43 content_->AddChildView(label_); 44 content_->AddChildView(label_);
44 OnUpdateVisibility(); 45 OnUpdateVisibility();
45 } 46 }
46 47
47 gfx::Size ManagedPrefsBannerView::GetPreferredSize() { 48 gfx::Size ManagedPrefsBannerView::GetPreferredSize() {
48 if (!IsVisible()) 49 if (!IsVisible())
49 return gfx::Size(); 50 return gfx::Size();
50 51
(...skipping 10 matching lines...) Expand all
61 void ManagedPrefsBannerView::ViewHierarchyChanged(bool is_add, 62 void ManagedPrefsBannerView::ViewHierarchyChanged(bool is_add,
62 views::View* parent, 63 views::View* parent,
63 views::View* child) { 64 views::View* child) {
64 if (is_add && child == this) 65 if (is_add && child == this)
65 Init(); 66 Init();
66 } 67 }
67 68
68 void ManagedPrefsBannerView::OnUpdateVisibility() { 69 void ManagedPrefsBannerView::OnUpdateVisibility() {
69 SetVisible(DetermineVisibility()); 70 SetVisible(DetermineVisibility());
70 } 71 }
OLDNEW
« no previous file with comments | « chrome/browser/views/collected_cookies_win.cc ('k') | views/box_layout.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698