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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm

Issue 1854223002: mac: Fix bookmark drag and drop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp37_dnd
Patch Set: Fix memory leak. Created 4 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2457 [BrowserWindowController browserWindowControllerForView:[self view]]; 2457 [BrowserWindowController browserWindowControllerForView:[self view]];
2458 return NSHeight([[browserController tabContentArea] frame]); 2458 return NSHeight([[browserController tabContentArea] frame]);
2459 } 2459 }
2460 2460
2461 - (Profile*)profile { 2461 - (Profile*)profile {
2462 return browser_->profile(); 2462 return browser_->profile();
2463 } 2463 }
2464 2464
2465 #pragma mark BookmarkButtonDelegate Protocol 2465 #pragma mark BookmarkButtonDelegate Protocol
2466 2466
2467 - (void)fillPasteboard:(NSPasteboard*)pboard 2467 - (NSPasteboardItem*)pasteboardItemForDragOfButton:(BookmarkButton*)button {
2468 forDragOfButton:(BookmarkButton*)button { 2468 return [[self folderTarget] pasteboardItemForDragOfButton:button];
2469 [[self folderTarget] fillPasteboard:pboard forDragOfButton:button];
2470 } 2469 }
2471 2470
2472 // BookmarkButtonDelegate protocol implementation. When menus are 2471 // BookmarkButtonDelegate protocol implementation. When menus are
2473 // "active" (e.g. you clicked to open one), moving the mouse over 2472 // "active" (e.g. you clicked to open one), moving the mouse over
2474 // another folder button should close the 1st and open the 2nd (like 2473 // another folder button should close the 1st and open the 2nd (like
2475 // real menus). We detect and act here. 2474 // real menus). We detect and act here.
2476 - (void)mouseEnteredButton:(id)sender event:(NSEvent*)event { 2475 - (void)mouseEnteredButton:(id)sender event:(NSEvent*)event {
2477 DCHECK([sender isKindOfClass:[BookmarkButton class]]); 2476 DCHECK([sender isKindOfClass:[BookmarkButton class]]);
2478 2477
2479 // If folder menus are not being shown, do nothing. This is different from 2478 // If folder menus are not being shown, do nothing. This is different from
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
2941 - (id<BookmarkButtonControllerProtocol>)controllerForNode: 2940 - (id<BookmarkButtonControllerProtocol>)controllerForNode:
2942 (const BookmarkNode*)node { 2941 (const BookmarkNode*)node {
2943 // See if it's in the bar, then if it is in the hierarchy of visible 2942 // See if it's in the bar, then if it is in the hierarchy of visible
2944 // folder menus. 2943 // folder menus.
2945 if (bookmarkModel_->bookmark_bar_node() == node) 2944 if (bookmarkModel_->bookmark_bar_node() == node)
2946 return self; 2945 return self;
2947 return [folderController_ controllerForNode:node]; 2946 return [folderController_ controllerForNode:node];
2948 } 2947 }
2949 2948
2950 @end 2949 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698