OLD | NEW |
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 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" | 11 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" |
11 #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" | 12 #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" |
12 #include "components/content_settings/core/common/content_settings_types.h" | 13 #include "components/content_settings/core/common/content_settings_types.h" |
13 #include "ui/gfx/animation/animation_delegate.h" | 14 #include "ui/gfx/animation/animation_delegate.h" |
14 #include "ui/gfx/animation/slide_animation.h" | 15 #include "ui/gfx/animation/slide_animation.h" |
15 #include "ui/views/painter.h" | 16 #include "ui/views/painter.h" |
16 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
17 #include "ui/views/widget/widget_observer.h" | 18 #include "ui/views/widget/widget_observer.h" |
18 | 19 |
19 class ContentSettingImageModel; | 20 class ContentSettingImageModel; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; | 85 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; |
85 | 86 |
86 // Called when the user clicks the view; this freezes the animation or snaps | 87 // Called when the user clicks the view; this freezes the animation or snaps |
87 // it to its end state as necessary and then opens a content setting bubble. | 88 // it to its end state as necessary and then opens a content setting bubble. |
88 void OnClick(); | 89 void OnClick(); |
89 | 90 |
90 // Updates the image and tooltip to match the current model state. | 91 // Updates the image and tooltip to match the current model state. |
91 void UpdateImage(); | 92 void UpdateImage(); |
92 | 93 |
93 LocationBarView* parent_; // Weak, owns us. | 94 LocationBarView* parent_; // Weak, owns us. |
94 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; | 95 std::unique_ptr<ContentSettingImageModel> content_setting_image_model_; |
95 gfx::SlideAnimation slide_animator_; | 96 gfx::SlideAnimation slide_animator_; |
96 bool pause_animation_; | 97 bool pause_animation_; |
97 double pause_animation_state_; | 98 double pause_animation_state_; |
98 views::BubbleDialogDelegateView* bubble_view_; | 99 views::BubbleDialogDelegateView* bubble_view_; |
99 | 100 |
100 // This is used to check if the bubble was showing during the mouse pressed | 101 // This is used to check if the bubble was showing during the mouse pressed |
101 // event. If this is true then the mouse released event is ignored to prevent | 102 // event. If this is true then the mouse released event is ignored to prevent |
102 // the bubble from reshowing. | 103 // the bubble from reshowing. |
103 bool suppress_mouse_released_action_; | 104 bool suppress_mouse_released_action_; |
104 | 105 |
105 // Animation delegate for the ink drop ripple effect. | 106 // Animation delegate for the ink drop ripple effect. |
106 scoped_ptr<views::InkDropDelegate> ink_drop_delegate_; | 107 std::unique_ptr<views::InkDropDelegate> ink_drop_delegate_; |
107 | 108 |
108 DISALLOW_COPY_AND_ASSIGN(ContentSettingImageView); | 109 DISALLOW_COPY_AND_ASSIGN(ContentSettingImageView); |
109 }; | 110 }; |
110 | 111 |
111 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ | 112 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ |
OLD | NEW |