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

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

Issue 9479008: Re-factor location bar/toolbar code to get rid of the browser dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 8 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "chrome/common/content_settings_types.h" 12 #include "chrome/common/content_settings_types.h"
13 #include "ui/base/animation/animation_delegate.h" 13 #include "ui/base/animation/animation_delegate.h"
14 #include "ui/views/controls/image_view.h" 14 #include "ui/views/controls/image_view.h"
15 #include "ui/views/widget/widget.h" 15 #include "ui/views/widget/widget.h"
16 16
17 class BrowserShowContentRelated;
17 class ContentSettingImageModel; 18 class ContentSettingImageModel;
18 class ContentSettingBubbleContents; 19 class ContentSettingBubbleContents;
19 class LocationBarView; 20 class LocationBarView;
20 class TabContents; 21 class TabContents;
21 22
22 namespace content { 23 namespace content {
23 class WebContents; 24 class WebContents;
24 } 25 }
25 26
26 namespace views { 27 namespace views {
27 class MouseEvent; 28 class MouseEvent;
28 } 29 }
29 30
30 namespace ui { 31 namespace ui {
31 class SlideAnimation; 32 class SlideAnimation;
32 } 33 }
33 34
34 class ContentSettingsDelegateView; 35 class ContentSettingsDelegateView;
35 36
36 class ContentSettingImageView : public views::ImageView, 37 class ContentSettingImageView : public views::ImageView,
37 public ui::AnimationDelegate, 38 public ui::AnimationDelegate,
38 public views::Widget::Observer { 39 public views::Widget::Observer {
39 public: 40 public:
40 ContentSettingImageView(ContentSettingsType content_type, 41 ContentSettingImageView(ContentSettingsType content_type,
41 LocationBarView* parent); 42 LocationBarView* parent,
43 BrowserShowContentRelated* delegate);
42 virtual ~ContentSettingImageView(); 44 virtual ~ContentSettingImageView();
43 45
44 // |new_navigation| true if this is a new navigation, false if the tab was 46 // |new_navigation| true if this is a new navigation, false if the tab was
45 // just switched to. 47 // just switched to.
46 void UpdateFromWebContents(content::WebContents* web_contents); 48 void UpdateFromWebContents(content::WebContents* web_contents);
47 49
48 // views::View overrides: 50 // views::View overrides:
49 virtual gfx::Size GetPreferredSize() OVERRIDE; 51 virtual gfx::Size GetPreferredSize() OVERRIDE;
50 52
51 // ui::AnimationDelegate overrides: 53 // ui::AnimationDelegate overrides:
(...skipping 11 matching lines...) Expand all
63 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 65 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
64 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE; 66 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE;
65 67
66 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; 68 scoped_ptr<ContentSettingImageModel> content_setting_image_model_;
67 69
68 views::Widget* bubble_widget_; 70 views::Widget* bubble_widget_;
69 71
70 // The owning LocationBarView. 72 // The owning LocationBarView.
71 LocationBarView* parent_; 73 LocationBarView* parent_;
72 74
75 BrowserShowContentRelated* delegate_;
76
73 scoped_ptr<ui::SlideAnimation> slide_animator_; 77 scoped_ptr<ui::SlideAnimation> slide_animator_;
74 string16 animated_text_; 78 string16 animated_text_;
75 bool pause_animation_; 79 bool pause_animation_;
76 int text_size_; 80 int text_size_;
77 int visible_text_size_; 81 int visible_text_size_;
78 gfx::Insets saved_insets_; 82 gfx::Insets saved_insets_;
79 83
80 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingImageView); 84 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingImageView);
81 }; 85 };
82 86
83 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ 87 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698