Add synchronous Widget closing event
[chromium-blink-merge.git] / chrome / browser / ui / views / location_bar / content_setting_image_view.h
blobf2cb048e1d15235bdd1b3bcfac72c4b2d4c90f26
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 {
22 public:
23 ContentSettingImageView(ContentSettingsType content_type,
24 const int background_images[],
25 LocationBarView* parent,
26 const gfx::Font& font,
27 SkColor font_color);
28 virtual ~ContentSettingImageView();
30 virtual void Update(content::WebContents* web_contents) OVERRIDE;
33 // views::WidgetObserver override:
34 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
36 protected:
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;
41 private:
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_