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/cocoa/bookmarks/bookmark_drag_drop_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_drag_drop_cocoa.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 #include "components/bookmarks/browser/bookmark_model.h" | 20 #include "components/bookmarks/browser/bookmark_model.h" |
21 #include "components/bookmarks/browser/bookmark_node_data.h" | 21 #include "components/bookmarks/browser/bookmark_node_data.h" |
22 #include "grit/ui_resources.h" | 22 #include "grit/ui_resources.h" |
23 #include "ui/base/dragdrop/drag_drop_types.h" | 23 #include "ui/base/dragdrop/drag_drop_types.h" |
24 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
25 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 25 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
26 | 26 |
| 27 using bookmarks::BookmarkNodeData; |
| 28 |
27 namespace chrome { | 29 namespace chrome { |
28 | 30 |
29 namespace { | 31 namespace { |
30 | 32 |
31 // Make a drag image from the drop data. | 33 // Make a drag image from the drop data. |
32 NSImage* MakeDragImage(BookmarkModel* model, | 34 NSImage* MakeDragImage(BookmarkModel* model, |
33 const std::vector<const BookmarkNode*>& nodes) { | 35 const std::vector<const BookmarkNode*>& nodes) { |
34 if (nodes.size() == 1) { | 36 if (nodes.size() == 1) { |
35 const BookmarkNode* node = nodes[0]; | 37 const BookmarkNode* node = nodes[0]; |
36 const gfx::Image& favicon = model->GetFavicon(node); | 38 const gfx::Image& favicon = model->GetFavicon(node); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 offset:NSZeroSize | 170 offset:NSZeroSize |
169 event:drag_event | 171 event:drag_event |
170 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] | 172 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] |
171 source:nil | 173 source:nil |
172 slideBack:YES]; | 174 slideBack:YES]; |
173 | 175 |
174 base::MessageLoop::current()->SetNestableTasksAllowed(was_nested); | 176 base::MessageLoop::current()->SetNestableTasksAllowed(was_nested); |
175 } | 177 } |
176 | 178 |
177 } // namespace chrome | 179 } // namespace chrome |
OLD | NEW |