OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_ | 5 #ifndef CHROME_BROWSER_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_ |
6 #define CHROME_BROWSER_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_ | 6 #define CHROME_BROWSER_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #import "chrome/browser/cocoa/location_bar/image_decoration.h" | 10 #import "chrome/browser/cocoa/location_bar/image_decoration.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // Updates the image and visibility state based on the supplied TabContents. | 28 // Updates the image and visibility state based on the supplied TabContents. |
29 void UpdateFromTabContents(const TabContents* tab_contents); | 29 void UpdateFromTabContents(const TabContents* tab_contents); |
30 | 30 |
31 // Overridden from |LocationBarDecoration| | 31 // Overridden from |LocationBarDecoration| |
32 virtual bool AcceptsMousePress() { return true; } | 32 virtual bool AcceptsMousePress() { return true; } |
33 virtual bool OnMousePressed(NSRect frame); | 33 virtual bool OnMousePressed(NSRect frame); |
34 virtual NSString* GetToolTip(); | 34 virtual NSString* GetToolTip(); |
35 | 35 |
36 private: | 36 private: |
| 37 // Helper to get where the bubble point should land. Similar to |
| 38 // |PageActionDecoration| or |StarDecoration| (|LocationBarViewMac| |
| 39 // calls those). |
| 40 NSPoint GetBubblePointInFrame(NSRect frame); |
| 41 |
37 void SetToolTip(NSString* tooltip); | 42 void SetToolTip(NSString* tooltip); |
38 | 43 |
39 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; | 44 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; |
40 | 45 |
41 LocationBarViewMac* owner_; // weak | 46 LocationBarViewMac* owner_; // weak |
42 Profile* profile_; // weak | 47 Profile* profile_; // weak |
43 | 48 |
44 scoped_nsobject<NSString> tooltip_; | 49 scoped_nsobject<NSString> tooltip_; |
45 | 50 |
46 DISALLOW_COPY_AND_ASSIGN(ContentSettingDecoration); | 51 DISALLOW_COPY_AND_ASSIGN(ContentSettingDecoration); |
47 }; | 52 }; |
48 | 53 |
49 #endif // CHROME_BROWSER_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_ | 54 #endif // CHROME_BROWSER_COCOA_LOCATION_BAR_CONTENT_SETTING_DECORATION_H_ |
OLD | NEW |