| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/themes/theme_properties.h" | 5 #include "chrome/browser/themes/theme_properties.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "chrome/browser/themes/browser_theme_pack.h" | 10 #include "chrome/browser/themes/browser_theme_pack.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // bottom of the row's icon and the top or bottom of the row edge. | 145 // bottom of the row's icon and the top or bottom of the row edge. |
| 146 const int kOmniboxDropdownMinIconVerticalPadding[] = {2, 4, 8}; | 146 const int kOmniboxDropdownMinIconVerticalPadding[] = {2, 4, 8}; |
| 147 | 147 |
| 148 // In an omnibox dropdown row, the minimum distance between the top and | 148 // In an omnibox dropdown row, the minimum distance between the top and |
| 149 // bottom of the row's text and the top or bottom of the row edge. | 149 // bottom of the row's text and the top or bottom of the row edge. |
| 150 const int kOmniboxDropdownMinTextVerticalPadding[] = {3, 4, 8}; | 150 const int kOmniboxDropdownMinTextVerticalPadding[] = {3, 4, 8}; |
| 151 | 151 |
| 152 // The spacing between a ToolbarButton's image and its border. | 152 // The spacing between a ToolbarButton's image and its border. |
| 153 const int kToolbarButtonBorderInset[] = {2, 6, 6}; | 153 const int kToolbarButtonBorderInset[] = {2, 6, 6}; |
| 154 | 154 |
| 155 // The minimum bottom vertical padding of the toolbar. |
| 156 const int kToolbarViewBottomVerticalPadding[] = {5, 5, 5}; |
| 157 |
| 155 // Non-ash uses a rounded content area with no shadow in the assets. | 158 // Non-ash uses a rounded content area with no shadow in the assets. |
| 156 const int kToolbarViewContentShadowHeight[] = {0, 0, 0}; | 159 const int kToolbarViewContentShadowHeight[] = {0, 0, 0}; |
| 157 | 160 |
| 158 // Ash doesn't use a rounded content area and its top edge has an extra shadow. | 161 // Ash doesn't use a rounded content area and its top edge has an extra shadow. |
| 159 const int kToolbarViewContentShadowHeightAsh[] = {2, 0, 0}; | 162 const int kToolbarViewContentShadowHeightAsh[] = {2, 0, 0}; |
| 160 | 163 |
| 161 // Additional horizontal padding between the elements in the toolbar. | 164 // Additional horizontal padding between the elements in the toolbar. |
| 162 const int kToolbarViewElementPadding[] = {0, 0, 8}; | 165 const int kToolbarViewElementPadding[] = {0, 0, 8}; |
| 163 | 166 |
| 164 // Padding between the right-edge of the location bar and browser actions. | 167 // Padding between the right-edge of the location bar and browser actions. |
| 165 const int kToolbarViewLocationBarRightPadding[] = {0, 4, 8}; | 168 const int kToolbarViewLocationBarRightPadding[] = {0, 4, 8}; |
| 166 | 169 |
| 167 // The edge graphics have some built-in spacing/shadowing, so we have to adjust | 170 // The edge graphics have some built-in spacing/shadowing, so we have to adjust |
| 168 // our spacing to make it match. | 171 // our spacing to make it match. |
| 169 const int kToolbarViewLeftEdgeSpacing[] = {3, 4, 8}; | 172 const int kToolbarViewLeftEdgeSpacing[] = {3, 4, 8}; |
| 170 const int kToolbarViewRightEdgeSpacing[] = {2, 4, 8}; | 173 const int kToolbarViewRightEdgeSpacing[] = {2, 4, 8}; |
| 171 | 174 |
| 172 // The horizontal space between most items. | 175 // The horizontal space between most items. |
| 173 const int kToolbarViewStandardSpacing[] = {3, 4, 8}; | 176 const int kToolbarViewStandardSpacing[] = {3, 4, 8}; |
| 174 | 177 |
| 175 // The minimal vertical padding of the toolbar. | 178 // The minimum top vertical padding of the toolbar. |
| 176 const int kToolbarViewVerticalPadding[] = {5, 4, 4}; | 179 const int kToolbarViewTopVerticalPadding[] = {5, 4, 4}; |
| 177 | 180 |
| 178 // ---------------------------------------------------------------------------- | 181 // ---------------------------------------------------------------------------- |
| 179 | 182 |
| 180 // Strings used in alignment properties. | 183 // Strings used in alignment properties. |
| 181 const char kAlignmentCenter[] = "center"; | 184 const char kAlignmentCenter[] = "center"; |
| 182 const char kAlignmentTop[] = "top"; | 185 const char kAlignmentTop[] = "top"; |
| 183 const char kAlignmentBottom[] = "bottom"; | 186 const char kAlignmentBottom[] = "bottom"; |
| 184 const char kAlignmentLeft[] = "left"; | 187 const char kAlignmentLeft[] = "left"; |
| 185 const char kAlignmentRight[] = "right"; | 188 const char kAlignmentRight[] = "right"; |
| 186 | 189 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 case PROPERTY_LOCATION_BAR_VERTICAL_PADDING: | 418 case PROPERTY_LOCATION_BAR_VERTICAL_PADDING: |
| 416 return kLocationBarVerticalPadding[mode]; | 419 return kLocationBarVerticalPadding[mode]; |
| 417 case PROPERTY_OMNIBOX_DROPDOWN_BORDER_INTERIOR: | 420 case PROPERTY_OMNIBOX_DROPDOWN_BORDER_INTERIOR: |
| 418 return kOmniboxDropdownBorderInterior[mode]; | 421 return kOmniboxDropdownBorderInterior[mode]; |
| 419 case PROPERTY_OMNIBOX_DROPDOWN_MIN_ICON_VERTICAL_PADDING: | 422 case PROPERTY_OMNIBOX_DROPDOWN_MIN_ICON_VERTICAL_PADDING: |
| 420 return kOmniboxDropdownMinIconVerticalPadding[mode]; | 423 return kOmniboxDropdownMinIconVerticalPadding[mode]; |
| 421 case PROPERTY_OMNIBOX_DROPDOWN_MIN_TEXT_VERTICAL_PADDING: | 424 case PROPERTY_OMNIBOX_DROPDOWN_MIN_TEXT_VERTICAL_PADDING: |
| 422 return kOmniboxDropdownMinTextVerticalPadding[mode]; | 425 return kOmniboxDropdownMinTextVerticalPadding[mode]; |
| 423 case PROPERTY_TOOLBAR_BUTTON_BORDER_INSET: | 426 case PROPERTY_TOOLBAR_BUTTON_BORDER_INSET: |
| 424 return kToolbarButtonBorderInset[mode]; | 427 return kToolbarButtonBorderInset[mode]; |
| 428 case PROPERTY_TOOLBAR_VIEW_BOTTOM_VERTICAL_PADDING: |
| 429 return kToolbarViewBottomVerticalPadding[mode]; |
| 425 case PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT: | 430 case PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT: |
| 426 return kToolbarViewContentShadowHeight[mode]; | 431 return kToolbarViewContentShadowHeight[mode]; |
| 427 case PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT_ASH: | 432 case PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT_ASH: |
| 428 return kToolbarViewContentShadowHeightAsh[mode]; | 433 return kToolbarViewContentShadowHeightAsh[mode]; |
| 429 case PROPERTY_TOOLBAR_VIEW_ELEMENT_PADDING: | 434 case PROPERTY_TOOLBAR_VIEW_ELEMENT_PADDING: |
| 430 return kToolbarViewElementPadding[mode]; | 435 return kToolbarViewElementPadding[mode]; |
| 431 case PROPERTY_TOOLBAR_VIEW_LEFT_EDGE_SPACING: | 436 case PROPERTY_TOOLBAR_VIEW_LEFT_EDGE_SPACING: |
| 432 return kToolbarViewLeftEdgeSpacing[mode]; | 437 return kToolbarViewLeftEdgeSpacing[mode]; |
| 433 case PROPERTY_TOOLBAR_VIEW_LOCATION_BAR_RIGHT_PADDING: | 438 case PROPERTY_TOOLBAR_VIEW_LOCATION_BAR_RIGHT_PADDING: |
| 434 return kToolbarViewLocationBarRightPadding[mode]; | 439 return kToolbarViewLocationBarRightPadding[mode]; |
| 435 case PROPERTY_TOOLBAR_VIEW_RIGHT_EDGE_SPACING: | 440 case PROPERTY_TOOLBAR_VIEW_RIGHT_EDGE_SPACING: |
| 436 return kToolbarViewRightEdgeSpacing[mode]; | 441 return kToolbarViewRightEdgeSpacing[mode]; |
| 437 case PROPERTY_TOOLBAR_VIEW_STANDARD_SPACING: | 442 case PROPERTY_TOOLBAR_VIEW_STANDARD_SPACING: |
| 438 return kToolbarViewStandardSpacing[mode]; | 443 return kToolbarViewStandardSpacing[mode]; |
| 439 case PROPERTY_TOOLBAR_VIEW_VERTICAL_PADDING: | 444 case PROPERTY_TOOLBAR_VIEW_TOP_VERTICAL_PADDING: |
| 440 return kToolbarViewVerticalPadding[mode]; | 445 return kToolbarViewTopVerticalPadding[mode]; |
| 441 default: | 446 default: |
| 442 return -1; | 447 return -1; |
| 443 } | 448 } |
| 444 } | 449 } |
| OLD | NEW |