| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <cmath> | 5 #include <cmath> |
| 6 | 6 |
| 7 #import "chrome/browser/ui/cocoa/location_bar/bubble_decoration.h" | 7 #import "chrome/browser/ui/cocoa/location_bar/bubble_decoration.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| 11 #import "chrome/browser/ui/cocoa/themed_window.h" | 11 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 12 #include "skia/ext/skia_utils_mac.h" | 12 #include "skia/ext/skia_utils_mac.h" |
| 13 #import "ui/base/cocoa/nsview_additions.h" | 13 #import "ui/base/cocoa/nsview_additions.h" |
| 14 #include "ui/base/material_design/material_design_controller.h" | 14 #include "ui/base/material_design/material_design_controller.h" |
| 15 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 15 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 // This is used to increase the right margin of this decoration. | 19 // This is used to increase the left padding of this decoration. |
| 20 const CGFloat kLeftSidePadding = 6.0; | 20 const CGFloat kLeftSidePadding = 5.0; |
| 21 | 21 |
| 22 // Padding between the icon/label and bubble edges. | 22 // Padding between the icon/label and bubble edges. |
| 23 const CGFloat kBubblePadding = 7.0; | 23 const CGFloat kBubblePadding = 7.0; |
| 24 | 24 |
| 25 // Additional padding between the divider and the label. | 25 // Additional padding between the divider and the label. |
| 26 const CGFloat kDividerPadding = 6.0; | 26 const CGFloat kDividerPadding = 6.0; |
| 27 | 27 |
| 28 // Padding between the icon and label. | 28 // Padding between the icon and label. |
| 29 const CGFloat kIconLabelPadding = 4.0; | 29 const CGFloat kIconLabelPadding = 4.0; |
| 30 | 30 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 [attributes_ setObject:text_color forKey:NSForegroundColorAttributeName]; | 183 [attributes_ setObject:text_color forKey:NSForegroundColorAttributeName]; |
| 184 } | 184 } |
| 185 | 185 |
| 186 void BubbleDecoration::SetFont(NSFont* font) { | 186 void BubbleDecoration::SetFont(NSFont* font) { |
| 187 [attributes_ setObject:font forKey:NSFontAttributeName]; | 187 [attributes_ setObject:font forKey:NSFontAttributeName]; |
| 188 } | 188 } |
| 189 | 189 |
| 190 void BubbleDecoration::SetRetinaBaselineOffset(CGFloat offset) { | 190 void BubbleDecoration::SetRetinaBaselineOffset(CGFloat offset) { |
| 191 retina_baseline_offset_ = offset; | 191 retina_baseline_offset_ = offset; |
| 192 } | 192 } |
| OLD | NEW |