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

Side by Side Diff: chrome/browser/ui/layout_constants.cc

Issue 2642893002: Adjust positioning of location bar icons. (Closed)
Patch Set: nits Created 3 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/layout_constants.h" 5 #include "chrome/browser/ui/layout_constants.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ui/base/material_design/material_design_controller.h" 9 #include "ui/base/material_design/material_design_controller.h"
10 10
11 int GetLayoutConstant(LayoutConstant constant) { 11 int GetLayoutConstant(LayoutConstant constant) {
12 const bool hybrid = ui::MaterialDesignController::GetMode() == 12 const bool hybrid = ui::MaterialDesignController::GetMode() ==
13 ui::MaterialDesignController::MATERIAL_HYBRID; 13 ui::MaterialDesignController::MATERIAL_HYBRID;
14 switch (constant) { 14 switch (constant) {
15 case LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING: 15 case LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING:
16 return hybrid ? 4 : 2; 16 return hybrid ? 4 : 2;
17 case LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET: 17 case LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET:
18 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) 18 if (ui::MaterialDesignController::IsSecondaryUiMaterial())
19 return 1; 19 return 1;
20 return hybrid ? 8 : 6; 20 return hybrid ? 8 : 6;
21 case LOCATION_BAR_ELEMENT_PADDING:
22 return hybrid ? 3 : 1;
21 case LOCATION_BAR_HEIGHT: 23 case LOCATION_BAR_HEIGHT:
22 return hybrid ? 32 : 28; 24 return hybrid ? 32 : 28;
23 case TABSTRIP_NEW_TAB_BUTTON_OVERLAP: 25 case TABSTRIP_NEW_TAB_BUTTON_OVERLAP:
24 return hybrid ? 6 : 5; 26 return hybrid ? 6 : 5;
25 case TAB_HEIGHT: 27 case TAB_HEIGHT:
26 return hybrid ? 33 : 29; 28 return hybrid ? 33 : 29;
27 case TOOLBAR_ELEMENT_PADDING: 29 case TOOLBAR_ELEMENT_PADDING:
28 return hybrid ? 8 : 0; 30 return hybrid ? 8 : 0;
29 case TOOLBAR_STANDARD_SPACING: 31 case TOOLBAR_STANDARD_SPACING:
30 return hybrid ? 8 : 4; 32 return hybrid ? 8 : 4;
(...skipping 16 matching lines...) Expand all
47 gfx::Size GetLayoutSize(LayoutSize size) { 49 gfx::Size GetLayoutSize(LayoutSize size) {
48 const bool hybrid = ui::MaterialDesignController::GetMode() == 50 const bool hybrid = ui::MaterialDesignController::GetMode() ==
49 ui::MaterialDesignController::MATERIAL_HYBRID; 51 ui::MaterialDesignController::MATERIAL_HYBRID;
50 switch (size) { 52 switch (size) {
51 case NEW_TAB_BUTTON: 53 case NEW_TAB_BUTTON:
52 return hybrid ? gfx::Size(39, 21) : gfx::Size(36, 18); 54 return hybrid ? gfx::Size(39, 21) : gfx::Size(36, 18);
53 } 55 }
54 NOTREACHED(); 56 NOTREACHED();
55 return gfx::Size(); 57 return gfx::Size();
56 } 58 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/layout_constants.h ('k') | chrome/browser/ui/views/location_bar/bubble_icon_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698