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

Unified Diff: chrome/browser/ui/views/infobars/infobar_view.cc

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 | « chrome/browser/ui/views/infobars/infobar_constants.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/infobars/infobar_view.cc
diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc
index fc620e9997c2fe8f49ea55967ffc09ece30e3f84..cab8e8dce2cf17c3ada75bbd7831d451bcfa3318 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.cc
+++ b/chrome/browser/ui/views/infobars/infobar_view.cc
@@ -48,18 +48,6 @@ bool SortLabelsByDecreasingWidth(views::Label* label_1, views::Label* label_2) {
} // namespace
-// InfoBar --------------------------------------------------------------------
-
-// static
-const int infobars::InfoBar::kSeparatorLineHeight =
- views::NonClientFrameView::kClientEdgeThickness;
-const int infobars::InfoBar::kDefaultArrowTargetHeight = 9;
-const int infobars::InfoBar::kMaximumArrowTargetHeight = 24;
-const int infobars::InfoBar::kDefaultArrowTargetHalfWidth =
- kDefaultArrowTargetHeight;
-const int infobars::InfoBar::kMaximumArrowTargetHalfWidth = 14;
-const int infobars::InfoBar::kDefaultBarTargetHeight = 36;
-
// InfoBarView ----------------------------------------------------------------
// static
@@ -155,9 +143,9 @@ void InfoBarView::Layout() {
delegate->GetInfoBarSeparatorColor());
int arrow_x;
SkScalar arrow_fill_height =
- SkIntToScalar(std::max(arrow_height() - kSeparatorLineHeight, 0));
+ SkIntToScalar(std::max(arrow_height() - gSeparatorLineHeight, 0));
SkScalar arrow_fill_half_width = SkIntToScalar(arrow_half_width());
- SkScalar separator_height = SkIntToScalar(kSeparatorLineHeight);
+ SkScalar separator_height = SkIntToScalar(gSeparatorLineHeight);
if (delegate->DrawInfoBarArrows(&arrow_x) && arrow_fill_height) {
// Skia pixel centers are at the half-values, so the arrow is horizontally
// centered at |arrow_x| + 0.5. Vertically, the stroke path is the center
@@ -185,7 +173,7 @@ void InfoBarView::Layout() {
}
if (bar_height()) {
fill_path_.addRect(0.0, SkIntToScalar(arrow_height()),
- SkIntToScalar(width()), SkIntToScalar(height() - kSeparatorLineHeight));
+ SkIntToScalar(width()), SkIntToScalar(height() - gSeparatorLineHeight));
}
int start_x = kEdgeItemPadding;
@@ -239,7 +227,7 @@ void InfoBarView::ViewHierarchyChanged(
// Ensure the infobar is tall enough to display its contents.
const int kMinimumVerticalPadding = 6;
- int height = kDefaultBarTargetHeight;
+ int height = gDefaultBarTargetHeight;
for (int i = 0; i < child_count(); ++i) {
const int child_height = child_at(i)->height();
height = std::max(height, child_height + kMinimumVerticalPadding);
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_constants.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698