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

Side by Side Diff: chrome/browser/ui/views/location_bar/content_setting_image_view.h

Issue 8603010: content settings bubble using new ui/views/bubble api. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ 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_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
11 #include "chrome/browser/ui/views/bubble/bubble.h"
12 #include "chrome/common/content_settings_types.h" 11 #include "chrome/common/content_settings_types.h"
13 #include "ui/base/animation/linear_animation.h" 12 #include "ui/base/animation/linear_animation.h"
14 #include "views/controls/image_view.h" 13 #include "views/controls/image_view.h"
15 14
16 class ContentSettingImageModel; 15 class ContentSettingImageModel;
17 class Bubble; 16 class ContentSettingBubbleContents;
18 class LocationBarView; 17 class LocationBarView;
19 class TabContents; 18 class TabContents;
20 19
21 namespace views { 20 namespace views {
22 class MouseEvent; 21 class MouseEvent;
23 } 22 }
24 23
24 class ContentSettingsDelegateView;
25
25 class ContentSettingImageView : public views::ImageView, 26 class ContentSettingImageView : public views::ImageView,
26 public BubbleDelegate,
27 public ui::LinearAnimation { 27 public ui::LinearAnimation {
28 public: 28 public:
29 ContentSettingImageView(ContentSettingsType content_type, 29 ContentSettingImageView(ContentSettingsType content_type,
30 LocationBarView* parent); 30 LocationBarView* parent);
31 virtual ~ContentSettingImageView(); 31 virtual ~ContentSettingImageView();
32 32
33 // |new_navigation| true if this is a new navigation, false if the tab was 33 // |new_navigation| true if this is a new navigation, false if the tab was
34 // just switched to. 34 // just switched to.
35 void UpdateFromTabContents(TabContents* tab_contents); 35 void UpdateFromTabContents(TabContents* tab_contents);
36 36
37 // views::View overrides: 37 // views::View overrides:
38 virtual gfx::Size GetPreferredSize(); 38 virtual gfx::Size GetPreferredSize();
39 39
40 private: 40 private:
41 // views::ImageView overrides: 41 // views::ImageView overrides:
42 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; 42 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
43 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; 43 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
44 virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE;
45 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 44 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
46 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE; 45 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE;
47 46
48 // BubbleDelegate overrides:
49 virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE;
50 virtual bool CloseOnEscape() OVERRIDE;
51 virtual bool FadeInOnShow() OVERRIDE;
52
53 // ui::LinearAnimation override: 47 // ui::LinearAnimation override:
54 virtual void AnimateToState(double state) OVERRIDE; 48 virtual void AnimateToState(double state) OVERRIDE;
55 49
56 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; 50 scoped_ptr<ContentSettingImageModel> content_setting_image_model_;
57 51
58 // The owning LocationBarView. 52 // The owning LocationBarView.
59 LocationBarView* parent_; 53 LocationBarView* parent_;
60 54
61 // The currently shown info bubble if any.
62 Bubble* bubble_;
63
64 string16 animated_text_; 55 string16 animated_text_;
65 bool animation_in_progress_; 56 bool animation_in_progress_;
66 int text_size_; 57 int text_size_;
67 int visible_text_size_; 58 int visible_text_size_;
68 gfx::Insets saved_insets_; 59 gfx::Insets saved_insets_;
69 60
70 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingImageView); 61 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingImageView);
71 }; 62 };
72 63
73 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ 64 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698