OLD | NEW |
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_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_ |
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_ | 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_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 #import "chrome/browser/ui/cocoa/location_bar/image_decoration.h" | 11 #import "chrome/browser/ui/cocoa/location_bar/image_decoration.h" |
11 #include "components/content_settings/core/common/content_settings_types.h" | 12 #include "components/content_settings/core/common/content_settings_types.h" |
12 | 13 |
13 // ContentSettingDecoration is used to display the content settings | 14 // ContentSettingDecoration is used to display the content settings |
14 // images on the current page. For example, the decoration animates into and out | 15 // images on the current page. For example, the decoration animates into and out |
15 // of view when a page attempts to show a popup and the popup blocker is on. | 16 // of view when a page attempts to show a popup and the popup blocker is on. |
16 | 17 |
17 @class ContentSettingAnimationState; | 18 @class ContentSettingAnimationState; |
18 class ContentSettingImageModel; | 19 class ContentSettingImageModel; |
19 class LocationBarViewMac; | 20 class LocationBarViewMac; |
(...skipping 30 matching lines...) Expand all Loading... |
50 private: | 51 private: |
51 | 52 |
52 void SetToolTip(NSString* tooltip); | 53 void SetToolTip(NSString* tooltip); |
53 | 54 |
54 // Returns an attributed string with the animated text. | 55 // Returns an attributed string with the animated text. |
55 base::scoped_nsobject<NSAttributedString> CreateAnimatedText(); | 56 base::scoped_nsobject<NSAttributedString> CreateAnimatedText(); |
56 | 57 |
57 // Measure the width of the animated text. | 58 // Measure the width of the animated text. |
58 CGFloat MeasureTextWidth(); | 59 CGFloat MeasureTextWidth(); |
59 | 60 |
60 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; | 61 std::unique_ptr<ContentSettingImageModel> content_setting_image_model_; |
61 | 62 |
62 LocationBarViewMac* owner_; // weak | 63 LocationBarViewMac* owner_; // weak |
63 Profile* profile_; // weak | 64 Profile* profile_; // weak |
64 | 65 |
65 base::scoped_nsobject<NSString> tooltip_; | 66 base::scoped_nsobject<NSString> tooltip_; |
66 | 67 |
67 // Used when the decoration has animated text. | 68 // Used when the decoration has animated text. |
68 base::scoped_nsobject<ContentSettingAnimationState> animation_; | 69 base::scoped_nsobject<ContentSettingAnimationState> animation_; |
69 CGFloat text_width_; | 70 CGFloat text_width_; |
70 base::scoped_nsobject<NSAttributedString> animated_text_; | 71 base::scoped_nsobject<NSAttributedString> animated_text_; |
71 | 72 |
72 DISALLOW_COPY_AND_ASSIGN(ContentSettingDecoration); | 73 DISALLOW_COPY_AND_ASSIGN(ContentSettingDecoration); |
73 }; | 74 }; |
74 | 75 |
75 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_ | 76 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_ |
OLD | NEW |