| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_bar_controller.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #import "base/mac/bundle_locations.h" | 9 #import "base/mac/bundle_locations.h" |
| 10 #import "base/mac/foundation_util.h" | 10 #import "base/mac/foundation_util.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 - (void)resetAllButtonPositionsWithAnimation:(BOOL)animate; | 248 - (void)resetAllButtonPositionsWithAnimation:(BOOL)animate; |
| 249 | 249 |
| 250 @end | 250 @end |
| 251 | 251 |
| 252 namespace bookmarks { | 252 namespace bookmarks { |
| 253 | 253 |
| 254 CGFloat BookmarkHorizontalPadding() { | 254 CGFloat BookmarkHorizontalPadding() { |
| 255 if (!ui::MaterialDesignController::IsModeMaterial()) { | 255 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 256 return 1.0; | 256 return 1.0; |
| 257 } | 257 } |
| 258 return 4.0; | 258 return 10.0; |
| 259 } | 259 } |
| 260 | 260 |
| 261 CGFloat BookmarkVerticalPadding() { | 261 CGFloat BookmarkVerticalPadding() { |
| 262 if (!ui::MaterialDesignController::IsModeMaterial()) { | 262 if (!ui::MaterialDesignController::IsModeMaterial()) { |
| 263 return 2.0; | 263 return 2.0; |
| 264 } | 264 } |
| 265 return 4.0; | 265 return 4.0; |
| 266 } | 266 } |
| 267 | 267 |
| 268 CGFloat BookmarkLeftMargin() { | 268 CGFloat BookmarkLeftMargin() { |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 NSOffsetRect(originalNoItemsRect_, | 511 NSOffsetRect(originalNoItemsRect_, |
| 512 kMaterialBookmarksTextfieldOffsetX, | 512 kMaterialBookmarksTextfieldOffsetX, |
| 513 kMaterialBookmarksTextfieldOffsetY).origin; | 513 kMaterialBookmarksTextfieldOffsetY).origin; |
| 514 [[buttonView_ noItemTextfield] setFrame:originalNoItemsRect_]; | 514 [[buttonView_ noItemTextfield] setFrame:originalNoItemsRect_]; |
| 515 | 515 |
| 516 originalImportBookmarksRect_.origin = | 516 originalImportBookmarksRect_.origin = |
| 517 NSOffsetRect(originalImportBookmarksRect_, | 517 NSOffsetRect(originalImportBookmarksRect_, |
| 518 kMaterialBookmarksTextfieldOffsetX, | 518 kMaterialBookmarksTextfieldOffsetX, |
| 519 kMaterialBookmarksTextfieldOffsetY).origin; | 519 kMaterialBookmarksTextfieldOffsetY).origin; |
| 520 [[buttonView_ importBookmarksButton] setFrame:originalImportBookmarksRect_]; | 520 [[buttonView_ importBookmarksButton] setFrame:originalImportBookmarksRect_]; |
| 521 | |
| 522 // Move the chevron button up 2pts from its position in the xib. | |
| 523 NSRect chevronButtonFrame = [offTheSideButton_ frame]; | |
| 524 chevronButtonFrame.origin.y += 2; | |
| 525 [offTheSideButton_ setFrame:chevronButtonFrame]; | |
| 526 } | 521 } |
| 527 | 522 |
| 528 // To make life happier when the bookmark bar is floating, the chevron is a | 523 // To make life happier when the bookmark bar is floating, the chevron is a |
| 529 // child of the button view. | 524 // child of the button view. |
| 530 [offTheSideButton_ removeFromSuperview]; | 525 [offTheSideButton_ removeFromSuperview]; |
| 531 [buttonView_ addSubview:offTheSideButton_]; | 526 [buttonView_ addSubview:offTheSideButton_]; |
| 532 | 527 |
| 533 // When resized we may need to add new buttons, or remove them (if | 528 // When resized we may need to add new buttons, or remove them (if |
| 534 // no longer visible), or add/remove the "off the side" menu. | 529 // no longer visible), or add/remove the "off the side" menu. |
| 535 [[self view] setPostsFrameChangedNotifications:YES]; | 530 [[self view] setPostsFrameChangedNotifications:YES]; |
| (...skipping 2559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3095 - (id<BookmarkButtonControllerProtocol>)controllerForNode: | 3090 - (id<BookmarkButtonControllerProtocol>)controllerForNode: |
| 3096 (const BookmarkNode*)node { | 3091 (const BookmarkNode*)node { |
| 3097 // See if it's in the bar, then if it is in the hierarchy of visible | 3092 // See if it's in the bar, then if it is in the hierarchy of visible |
| 3098 // folder menus. | 3093 // folder menus. |
| 3099 if (bookmarkModel_->bookmark_bar_node() == node) | 3094 if (bookmarkModel_->bookmark_bar_node() == node) |
| 3100 return self; | 3095 return self; |
| 3101 return [folderController_ controllerForNode:node]; | 3096 return [folderController_ controllerForNode:node]; |
| 3102 } | 3097 } |
| 3103 | 3098 |
| 3104 @end | 3099 @end |
| OLD | NEW |