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

Unified Diff: chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc

Issue 1421683002: Update search chip icon for MD, vectorize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 2 months 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
Index: chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
index 3e8a3e64d86fe9ae6158eed09e6a6f4bcb6b0fc6..82517aaecc01ba4c7bb79c4644690e8283709f14 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
@@ -6,6 +6,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/views/layout_constants.h"
+#include "ui/base/resource/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
@@ -100,9 +101,14 @@ gfx::Size IconLabelBubbleView::GetPreferredSize() const {
}
void IconLabelBubbleView::Layout() {
+ // In MD mode, both extension icons and Chrome-provided icons are 16px,
+ // so it's not necessary to handle them differently. TODO(estade): clean
+ // this up when MD is on by default.
+ bool is_extension_icon = ui::MaterialDesignController::IsModeMaterial() ?
Peter Kasting 2015/10/23 23:44:09 Nit: Seems clearer? bool is_extension_icon =
+ false : is_extension_icon_;
Peter Kasting 2015/10/23 23:44:09 Nit: Seems clearer? bool is_extension_icon =
Evan Stade 2015/10/26 19:29:19 done
const int image_width = image()->GetPreferredSize().width();
image_->SetBounds(std::min((width() - image_width) / 2,
- GetBubbleOuterPadding(!is_extension_icon_)),
+ GetBubbleOuterPadding(!is_extension_icon)),
0, image_->GetPreferredSize().width(), height());
const int padding = GetLayoutConstant(ICON_LABEL_VIEW_INTERNAL_PADDING);

Powered by Google App Engine
This is Rietveld 408576698