| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" | 9 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" |
| 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
| 11 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_context_menu_cocoa_controlle
r.h" | 11 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_context_menu_cocoa_controlle
r.h" |
| 12 #include "chrome/grit/generated_resources.h" | 12 #include "chrome/grit/generated_resources.h" |
| 13 #import "components/bookmarks/browser/bookmark_model.h" | 13 #import "components/bookmarks/browser/bookmark_model.h" |
| 14 #include "content/public/browser/user_metrics.h" | 14 #include "content/public/browser/user_metrics.h" |
| 15 #import "ui/base/cocoa/nsview_additions.h" |
| 15 #include "ui/base/l10n/l10n_util_mac.h" | 16 #include "ui/base/l10n/l10n_util_mac.h" |
| 16 #include "ui/base/material_design/material_design_controller.h" | 17 #include "ui/base/material_design/material_design_controller.h" |
| 17 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
| 18 #include "ui/resources/grit/ui_resources.h" | 19 #include "ui/resources/grit/ui_resources.h" |
| 19 | 20 |
| 20 using base::UserMetricsAction; | 21 using base::UserMetricsAction; |
| 21 using bookmarks::BookmarkNode; | 22 using bookmarks::BookmarkNode; |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 387 } |
| 387 } | 388 } |
| 388 | 389 |
| 389 - (int)verticalTextOffset { | 390 - (int)verticalTextOffset { |
| 390 if (!ui::MaterialDesignController::IsModeMaterial()) { | 391 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 391 return 0; | 392 return 0; |
| 392 } | 393 } |
| 393 return -1; | 394 return -1; |
| 394 } | 395 } |
| 395 | 396 |
| 397 - (CGFloat)hoverBackgroundVerticalOffsetInControlView:(NSView*)controlView { |
| 398 // In Material Design on Retina, and not in a folder menu, nudge the hover |
| 399 // background by 1px. |
| 400 const CGFloat kLineWidth = [controlView cr_lineWidth]; |
| 401 if ([self tag] == kMaterialStandardButtonTypeWithLimitedClickFeedback && |
| 402 ![self isFolderButtonCell] && kLineWidth < 1) { |
| 403 return -kLineWidth; |
| 404 } |
| 405 return 0.0; |
| 406 } |
| 407 |
| 408 |
| 396 @end | 409 @end |
| OLD | NEW |