| 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_bar_view.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #import "chrome/browser/themes/theme_properties.h" | 8 #import "chrome/browser/themes/theme_properties.h" |
| 9 #import "chrome/browser/themes/theme_service.h" | 9 #import "chrome/browser/themes/theme_service.h" |
| 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 220 |
| 221 // If we're dragging from one profile to another, disallow moving (only | 221 // If we're dragging from one profile to another, disallow moving (only |
| 222 // allow copying). Each profile has its own bookmark model, so one way to | 222 // allow copying). Each profile has its own bookmark model, so one way to |
| 223 // check whether we are dragging across profiles is to see if the | 223 // check whether we are dragging across profiles is to see if the |
| 224 // |BookmarkNode| corresponding to |button| exists in this profile. If it | 224 // |BookmarkNode| corresponding to |button| exists in this profile. If it |
| 225 // does, we're dragging within a profile; otherwise, we're dragging across | 225 // does, we're dragging within a profile; otherwise, we're dragging across |
| 226 // profiles. | 226 // profiles. |
| 227 const BookmarkModel* const model = [[self controller] bookmarkModel]; | 227 const BookmarkModel* const model = [[self controller] bookmarkModel]; |
| 228 const BookmarkNode* const source_node = [button bookmarkNode]; | 228 const BookmarkNode* const source_node = [button bookmarkNode]; |
| 229 const BookmarkNode* const target_node = | 229 const BookmarkNode* const target_node = |
| 230 GetBookmarkNodeByID(model, source_node->id()); | 230 bookmarks::GetBookmarkNodeByID(model, source_node->id()); |
| 231 | 231 |
| 232 BOOL copy = | 232 BOOL copy = |
| 233 !([info draggingSourceOperationMask] & NSDragOperationMove) || | 233 !([info draggingSourceOperationMask] & NSDragOperationMove) || |
| 234 (source_node != target_node); | 234 (source_node != target_node); |
| 235 rtn = [controller_ dragButton:button | 235 rtn = [controller_ dragButton:button |
| 236 to:[info draggingLocation] | 236 to:[info draggingLocation] |
| 237 copy:copy]; | 237 copy:copy]; |
| 238 content::RecordAction(UserMetricsAction("BookmarkBar_DragEnd")); | 238 content::RecordAction(UserMetricsAction("BookmarkBar_DragEnd")); |
| 239 } | 239 } |
| 240 return rtn; | 240 return rtn; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 278 |
| 279 @end // @implementation BookmarkBarTextField | 279 @end // @implementation BookmarkBarTextField |
| 280 | 280 |
| 281 @implementation BookmarkBarItemContainer | 281 @implementation BookmarkBarItemContainer |
| 282 | 282 |
| 283 - (NSMenu*)menu { | 283 - (NSMenu*)menu { |
| 284 return [barView_ menu]; | 284 return [barView_ menu]; |
| 285 } | 285 } |
| 286 | 286 |
| 287 @end // @implementation BookmarkBarItemContainer | 287 @end // @implementation BookmarkBarItemContainer |
| OLD | NEW |