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

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_actions_bar.cc

Issue 1870333002: [Mac][Material Design] Change toolbar buttons to 24x24 from 28x28. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix conditional. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/layout_constants.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" 5 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 27 matching lines...) Expand all
38 #include "ui/gfx/image/image_skia.h" 38 #include "ui/gfx/image/image_skia.h"
39 39
40 namespace { 40 namespace {
41 41
42 using WeakToolbarActions = std::vector<ToolbarActionViewController*>; 42 using WeakToolbarActions = std::vector<ToolbarActionViewController*>;
43 43
44 enum DimensionType { WIDTH, HEIGHT }; 44 enum DimensionType { WIDTH, HEIGHT };
45 45
46 // Returns the width or height of the toolbar action icon size. 46 // Returns the width or height of the toolbar action icon size.
47 int GetIconDimension(DimensionType type) { 47 int GetIconDimension(DimensionType type) {
48 if (ui::MaterialDesignController::IsModeMaterial()) 48 if (ui::MaterialDesignController::IsModeMaterial())
49 #if defined(OS_MACOSX)
50 // On the Mac, the spec is a 24x24 button in a 28x28 space.
51 return 24;
52 #else
49 return 28; 53 return 28;
54 #endif
50 55
51 static bool initialized = false; 56 static bool initialized = false;
52 static int icon_height = 0; 57 static int icon_height = 0;
53 static int icon_width = 0; 58 static int icon_width = 0;
54 if (!initialized) { 59 if (!initialized) {
55 initialized = true; 60 initialized = true;
56 gfx::ImageSkia* skia = 61 gfx::ImageSkia* skia =
57 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 62 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
58 IDR_BROWSER_ACTION); 63 IDR_BROWSER_ACTION);
59 icon_height = skia->height(); 64 icon_height = skia->height();
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 for (ToolbarActionViewController* action : toolbar_actions_) { 788 for (ToolbarActionViewController* action : toolbar_actions_) {
784 if (action->GetId() == action_id) 789 if (action->GetId() == action_id)
785 return action; 790 return action;
786 } 791 }
787 return nullptr; 792 return nullptr;
788 } 793 }
789 794
790 content::WebContents* ToolbarActionsBar::GetCurrentWebContents() { 795 content::WebContents* ToolbarActionsBar::GetCurrentWebContents() {
791 return browser_->tab_strip_model()->GetActiveWebContents(); 796 return browser_->tab_strip_model()->GetActiveWebContents();
792 } 797 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/layout_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698