1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/ui/views/location_bar/location_bar_decoration_view.h"
11 #include "chrome/common/content_settings_types.h"
12 #include "ui/views/widget/widget_observer.h"
14 class ContentSettingImageModel
;
15 class LocationBarView
;
17 // The ContentSettingImageView displays an icon and optional text label for
18 // various content settings affordances in the location bar (i.e. plugin
19 // blocking, geolocation).
20 class ContentSettingImageView
: public LocationBarDecorationView
,
21 public views::WidgetObserver
{
23 ContentSettingImageView(ContentSettingsType content_type
,
24 const int background_images
[],
25 LocationBarView
* parent
,
26 const gfx::Font
& font
,
28 virtual ~ContentSettingImageView();
30 virtual void Update(content::WebContents
* web_contents
) OVERRIDE
;
33 // views::WidgetObserver override:
34 virtual void OnWidgetDestroying(views::Widget
* widget
) OVERRIDE
;
37 // Invoked when the user clicks on the control.
38 virtual void OnClick(LocationBarView
* parent
) OVERRIDE
;
39 virtual int GetTextAnimationSize(double state
, int text_size
) OVERRIDE
;
42 scoped_ptr
<ContentSettingImageModel
> content_setting_image_model_
;
44 views::Widget
* bubble_widget_
;
46 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingImageView
);
49 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_