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

Unified Diff: chrome/browser/ui/toolbar/toolbar_actions_bar.cc

Issue 2444923003: Some more pre-material cleanups (Closed)
Patch Set: pkasting review Created 4 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
« no previous file with comments | « chrome/browser/ui/layout_constants.cc ('k') | chrome/browser/ui/views/infobars/infobar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/toolbar_actions_bar.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
index 8d06aa097e7459bcc6b7f63e005a30128c83c71f..72f85cc804889a821b1695b5c2608ed721da1e22 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
+++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
@@ -35,7 +35,6 @@
#include "extensions/browser/runtime_data.h"
#include "extensions/common/extension.h"
#include "extensions/common/feature_switch.h"
-#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image_skia.h"
@@ -45,30 +44,6 @@ using WeakToolbarActions = std::vector<ToolbarActionViewController*>;
enum DimensionType { WIDTH, HEIGHT };
-// Returns the width or height of the toolbar action icon size.
-int GetIconDimension(DimensionType type) {
-if (ui::MaterialDesignController::IsModeMaterial())
-#if defined(OS_MACOSX)
- // On the Mac, the spec is a 24x24 button in a 28x28 space.
- return 24;
-#else
- return 28;
-#endif
-
- static bool initialized = false;
- static int icon_height = 0;
- static int icon_width = 0;
- if (!initialized) {
- initialized = true;
- gfx::ImageSkia* skia =
- ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
- IDR_BROWSER_ACTION);
- icon_height = skia->height();
- icon_width = skia->width();
- }
- return type == WIDTH ? icon_width : icon_height;
-}
-
// Takes a reference vector |reference| of length n, where n is less than or
// equal to the length of |to_sort|, and rearranges |to_sort| so that
// |to_sort|'s first n elements match the n elements of |reference| (the order
@@ -155,13 +130,18 @@ ToolbarActionsBar::~ToolbarActionsBar() {
// static
int ToolbarActionsBar::IconWidth(bool include_padding) {
- return GetIconDimension(WIDTH) +
+ return IconHeight() +
(include_padding ? GetLayoutConstant(TOOLBAR_STANDARD_SPACING) : 0);
}
// static
int ToolbarActionsBar::IconHeight() {
- return GetIconDimension(HEIGHT);
+#if defined(OS_MACOSX)
+ // On the Mac, the spec is a 24x24 button in a 28x28 space.
+ return 24;
+#else
+ return 28;
+#endif
}
// static
« no previous file with comments | « chrome/browser/ui/layout_constants.cc ('k') | chrome/browser/ui/views/infobars/infobar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698