Index: chrome/browser/ui/cocoa/location_bar/secure_verbose_bubble_decoration.h |
diff --git a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.h b/chrome/browser/ui/cocoa/location_bar/secure_verbose_bubble_decoration.h |
similarity index 58% |
rename from chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.h |
rename to chrome/browser/ui/cocoa/location_bar/secure_verbose_bubble_decoration.h |
index 97cd4b8e8dba47c3dddd44198d3980a874e16ec3..8b0c07216a1b171ce892402fb9523289d3904ecd 100644 |
--- a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.h |
+++ b/chrome/browser/ui/cocoa/location_bar/secure_verbose_bubble_decoration.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_EV_BUBBLE_DECORATION_H_ |
-#define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_EV_BUBBLE_DECORATION_H_ |
+#ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_SECURE_VERBOSE_BUBBLE_DECORATION_H_ |
+#define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_SECURE_VERBOSE_BUBBLE_DECORATION_H_ |
#import <Cocoa/Cocoa.h> |
@@ -14,17 +14,22 @@ |
// icon plus a label from the certification, and will replace the |
// location icon for URLs which have an EV cert. The |location_icon| |
// is used to fulfill drag-related calls. |
- |
+// In Material Design, it will also draw the secure verbose bubble. |
+// The bubble is exactly the same as the EV bubble, but potentially with a |
+// different security icon and color. |
// TODO(shess): Refactor to pull the |location_icon| functionality out |
// into a distinct class like views |ClickHandler|. |
// http://crbug.com/48866 |
+class LocationBarViewMac; |
class LocationIconDecoration; |
+@class SecureVerboseAnimation; |
-class EVBubbleDecoration : public BubbleDecoration { |
+class SecureVerboseBubbleDecoration : public BubbleDecoration { |
public: |
- explicit EVBubbleDecoration(LocationIconDecoration* location_icon); |
- ~EVBubbleDecoration() override; |
+ explicit SecureVerboseBubbleDecoration(LocationIconDecoration* location_icon, |
+ LocationBarViewMac* owner); |
+ ~SecureVerboseBubbleDecoration() override; |
// Return the color used to draw the EvBubbleDecoration background in MD. |
NSColor* GetBackgroundBorderColor() override; |
@@ -33,6 +38,17 @@ class EVBubbleDecoration : public BubbleDecoration { |
// fits, else it will set an elided version. |
void SetFullLabel(NSString* full_label); |
+ // Set the color of the label. If this is not set, the label color will |
+ // default to kGoogleGreen700. |
+ void SetLabelColor(NSColor* color); |
+ |
+ // Called by SecureVerboseAnimation when the animation has progressed. |
+ void OnAnimationProgressed(); |
+ |
+ // Starts the animation. If the animation has already started, it will |
+ // restart. |
+ void StartAnimation(); |
+ |
// Implement |LocationBarDecoration|. |
CGFloat GetWidthForSpace(CGFloat width) override; |
@@ -56,9 +72,17 @@ class EVBubbleDecoration : public BubbleDecoration { |
// The real label. BubbleDecoration's label may be elided. |
base::scoped_nsobject<NSString> full_label_; |
+ // The color of the label's text. |
+ base::scoped_nsobject<NSColor> label_color_; |
+ |
LocationIconDecoration* location_icon_; // weak, owned by location bar. |
- DISALLOW_COPY_AND_ASSIGN(EVBubbleDecoration); |
+ // The animation. |
+ base::scoped_nsobject<SecureVerboseAnimation> animation_; |
+ |
+ LocationBarViewMac* owner_; // weak |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SecureVerboseBubbleDecoration); |
}; |
-#endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_EV_BUBBLE_DECORATION_H_ |
+#endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_SECURE_VERBOSE_BUBBLE_DECORATION_H_ |