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

Unified Diff: components/infobars/core/infobar.h

Issue 752853005: Remove dependency from infobars component to the embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/infobars.gypi ('k') | components/infobars/core/infobar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/infobars/core/infobar.h
diff --git a/components/infobars/core/infobar.h b/components/infobars/core/infobar.h
index 6124d880c784c45ce94abb5922d5108b9f52314a..77e6ff1610b04bcdfb38ead6a231d06ea68c6c8a 100644
--- a/components/infobars/core/infobar.h
+++ b/components/infobars/core/infobar.h
@@ -40,19 +40,30 @@ class InfoBar : public gfx::AnimationDelegate {
typedef InfoBar AddedDetails;
typedef std::pair<InfoBar*, bool> RemovedDetails;
- // Platforms must define these.
- static const int kDefaultBarTargetHeight;
- static const int kSeparatorLineHeight;
- static const int kDefaultArrowTargetHeight;
- static const int kMaximumArrowTargetHeight;
+ // Those globals must be initialized by the embedder before doing calling
+ // any of the method of the component via Initialize() call.
+ static int gDefaultBarTargetHeight;
+ static int gSeparatorLineHeight;
+ static int gDefaultArrowTargetHeight;
+ static int gMaximumArrowTargetHeight;
// The half-width (see comments on |arrow_half_width_| below) scales to its
// default and maximum values proportionally to how the height scales to its.
- static const int kDefaultArrowTargetHalfWidth;
- static const int kMaximumArrowTargetHalfWidth;
+ static int gDefaultArrowTargetHalfWidth;
+ static int gMaximumArrowTargetHalfWidth;
explicit InfoBar(scoped_ptr<InfoBarDelegate> delegate);
~InfoBar() override;
+ // Initializes the globals by the infobar component. Must be called by the
+ // embedder to provides its own value before making any call into the
+ // component.
+ static void Initialize(int defaultBarTargetHeight,
+ int separatorLineHeight,
+ int defaultArrowTargetHeight,
+ int maximumArrowTargetHeight,
+ int defaultArrowTargetHalfWidth,
+ int maximumArrowTargetHalfWidth);
+
static SkColor GetTopColor(InfoBarDelegate::Type infobar_type);
static SkColor GetBottomColor(InfoBarDelegate::Type infobar_type);
« no previous file with comments | « components/infobars.gypi ('k') | components/infobars/core/infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698