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

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

Issue 386283002: Move bookmark_utils into bookmarks namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
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_bar_folder_view.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" 8 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h" 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h"
10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 // If we're dragging from one profile to another, disallow moving (only 156 // If we're dragging from one profile to another, disallow moving (only
157 // allow copying). Each profile has its own bookmark model, so one way to 157 // allow copying). Each profile has its own bookmark model, so one way to
158 // check whether we are dragging across profiles is to see if the 158 // check whether we are dragging across profiles is to see if the
159 // |BookmarkNode| corresponding to |button| exists in this profile. If it 159 // |BookmarkNode| corresponding to |button| exists in this profile. If it
160 // does, we're dragging within a profile; otherwise, we're dragging across 160 // does, we're dragging within a profile; otherwise, we're dragging across
161 // profiles. 161 // profiles.
162 const BookmarkModel* const model = [[self controller] bookmarkModel]; 162 const BookmarkModel* const model = [[self controller] bookmarkModel];
163 const BookmarkNode* const source_node = [button bookmarkNode]; 163 const BookmarkNode* const source_node = [button bookmarkNode];
164 const BookmarkNode* const target_node = 164 const BookmarkNode* const target_node =
165 GetBookmarkNodeByID(model, source_node->id()); 165 bookmarks::GetBookmarkNodeByID(model, source_node->id());
166 166
167 BOOL copy = 167 BOOL copy =
168 !([info draggingSourceOperationMask] & NSDragOperationMove) || 168 !([info draggingSourceOperationMask] & NSDragOperationMove) ||
169 (source_node != target_node); 169 (source_node != target_node);
170 doDrag = [[self controller] dragButton:button 170 doDrag = [[self controller] dragButton:button
171 to:[info draggingLocation] 171 to:[info draggingLocation]
172 copy:copy]; 172 copy:copy];
173 content::RecordAction(UserMetricsAction("BookmarkBarFolder_DragEnd")); 173 content::RecordAction(UserMetricsAction("BookmarkBarFolder_DragEnd"));
174 } 174 }
175 return doDrag; 175 return doDrag;
(...skipping 24 matching lines...) Expand all
200 [dropIndicator_ setBorderType:NSLineBorder]; 200 [dropIndicator_ setBorderType:NSLineBorder];
201 [dropIndicator_ setAlphaValue:0.85]; 201 [dropIndicator_ setAlphaValue:0.85];
202 [self addSubview:dropIndicator_]; 202 [self addSubview:dropIndicator_];
203 } else { 203 } else {
204 [dropIndicator_ removeFromSuperview]; 204 [dropIndicator_ removeFromSuperview];
205 dropIndicator_.reset(); 205 dropIndicator_.reset();
206 } 206 }
207 } 207 }
208 208
209 @end 209 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698