| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/mac/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "base/strings/sys_string_conversions.h" | 15 #include "base/strings/sys_string_conversions.h" |
| 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" | 18 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" |
| 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| 20 #import "chrome/browser/ui/cocoa/drag_util.h" | 20 #import "chrome/browser/ui/cocoa/drag_util.h" |
| 21 #include "components/bookmarks/browser/bookmark_model.h" | 21 #include "components/bookmarks/browser/bookmark_model.h" |
| 22 #include "components/bookmarks/browser/bookmark_node_data.h" | 22 #include "components/bookmarks/browser/bookmark_node_data.h" |
| 23 #include "ui/base/dragdrop/drag_drop_types.h" | 23 #include "ui/base/dragdrop/drag_drop_types.h" |
| 24 | 24 |
| 25 using bookmarks::BookmarkModel; | 25 using bookmarks::BookmarkModel; |
| 26 using bookmarks::BookmarkNode; |
| 26 | 27 |
| 27 namespace { | 28 namespace { |
| 28 | 29 |
| 29 // Make a drag image from the drop data. | 30 // Make a drag image from the drop data. |
| 30 NSImage* MakeDragImage(BookmarkModel* model, | 31 NSImage* MakeDragImage(BookmarkModel* model, |
| 31 const std::vector<const BookmarkNode*>& nodes) { | 32 const std::vector<const BookmarkNode*>& nodes) { |
| 32 if (nodes.size() == 1) { | 33 if (nodes.size() == 1) { |
| 33 const BookmarkNode* node = nodes[0]; | 34 const BookmarkNode* node = nodes[0]; |
| 34 const gfx::Image& favicon = model->GetFavicon(node); | 35 const gfx::Image& favicon = model->GetFavicon(node); |
| 35 return drag_util::DragImageForBookmark( | 36 return drag_util::DragImageForBookmark( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 offset:NSZeroSize | 89 offset:NSZeroSize |
| 89 event:drag_event | 90 event:drag_event |
| 90 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] | 91 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] |
| 91 source:nil | 92 source:nil |
| 92 slideBack:YES]; | 93 slideBack:YES]; |
| 93 | 94 |
| 94 base::MessageLoop::current()->SetNestableTasksAllowed(was_nested); | 95 base::MessageLoop::current()->SetNestableTasksAllowed(was_nested); |
| 95 } | 96 } |
| 96 | 97 |
| 97 } // namespace chrome | 98 } // namespace chrome |
| OLD | NEW |