OLD | NEW |
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 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage
r_private_api.h" | 5 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage
r_private_api.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "content/public/browser/render_view_host.h" | 36 #include "content/public/browser/render_view_host.h" |
37 #include "content/public/browser/web_contents.h" | 37 #include "content/public/browser/web_contents.h" |
38 #include "content/public/browser/web_ui.h" | 38 #include "content/public/browser/web_ui.h" |
39 #include "extensions/browser/extension_function_dispatcher.h" | 39 #include "extensions/browser/extension_function_dispatcher.h" |
40 #include "extensions/browser/view_type_utils.h" | 40 #include "extensions/browser/view_type_utils.h" |
41 #include "ui/base/dragdrop/drag_drop_types.h" | 41 #include "ui/base/dragdrop/drag_drop_types.h" |
42 #include "ui/base/l10n/l10n_util.h" | 42 #include "ui/base/l10n/l10n_util.h" |
43 #include "ui/base/webui/web_ui_util.h" | 43 #include "ui/base/webui/web_ui_util.h" |
44 | 44 |
45 using bookmarks::BookmarkModel; | 45 using bookmarks::BookmarkModel; |
| 46 using bookmarks::BookmarkNode; |
46 using bookmarks::BookmarkNodeData; | 47 using bookmarks::BookmarkNodeData; |
| 48 using content::WebContents; |
47 | 49 |
48 namespace extensions { | 50 namespace extensions { |
49 | 51 |
50 namespace bookmark_keys = bookmark_api_constants; | 52 namespace bookmark_keys = bookmark_api_constants; |
51 namespace bookmark_manager_private = api::bookmark_manager_private; | 53 namespace bookmark_manager_private = api::bookmark_manager_private; |
52 namespace CanPaste = api::bookmark_manager_private::CanPaste; | 54 namespace CanPaste = api::bookmark_manager_private::CanPaste; |
53 namespace Copy = api::bookmark_manager_private::Copy; | 55 namespace Copy = api::bookmark_manager_private::Copy; |
54 namespace CreateWithMetaInfo = | 56 namespace CreateWithMetaInfo = |
55 api::bookmark_manager_private::CreateWithMetaInfo; | 57 api::bookmark_manager_private::CreateWithMetaInfo; |
56 namespace Cut = api::bookmark_manager_private::Cut; | 58 namespace Cut = api::bookmark_manager_private::Cut; |
57 namespace Drop = api::bookmark_manager_private::Drop; | 59 namespace Drop = api::bookmark_manager_private::Drop; |
58 namespace GetSubtree = api::bookmark_manager_private::GetSubtree; | 60 namespace GetSubtree = api::bookmark_manager_private::GetSubtree; |
59 namespace GetMetaInfo = api::bookmark_manager_private::GetMetaInfo; | 61 namespace GetMetaInfo = api::bookmark_manager_private::GetMetaInfo; |
60 namespace Paste = api::bookmark_manager_private::Paste; | 62 namespace Paste = api::bookmark_manager_private::Paste; |
61 namespace RedoInfo = api::bookmark_manager_private::GetRedoInfo; | 63 namespace RedoInfo = api::bookmark_manager_private::GetRedoInfo; |
62 namespace RemoveTrees = api::bookmark_manager_private::RemoveTrees; | 64 namespace RemoveTrees = api::bookmark_manager_private::RemoveTrees; |
63 namespace SetMetaInfo = api::bookmark_manager_private::SetMetaInfo; | 65 namespace SetMetaInfo = api::bookmark_manager_private::SetMetaInfo; |
64 namespace SetVersion = api::bookmark_manager_private::SetVersion; | 66 namespace SetVersion = api::bookmark_manager_private::SetVersion; |
65 namespace SortChildren = api::bookmark_manager_private::SortChildren; | 67 namespace SortChildren = api::bookmark_manager_private::SortChildren; |
66 namespace StartDrag = api::bookmark_manager_private::StartDrag; | 68 namespace StartDrag = api::bookmark_manager_private::StartDrag; |
67 namespace UndoInfo = api::bookmark_manager_private::GetUndoInfo; | 69 namespace UndoInfo = api::bookmark_manager_private::GetUndoInfo; |
68 namespace UpdateMetaInfo = api::bookmark_manager_private::UpdateMetaInfo; | 70 namespace UpdateMetaInfo = api::bookmark_manager_private::UpdateMetaInfo; |
69 | 71 |
70 using content::WebContents; | |
71 | |
72 namespace { | 72 namespace { |
73 | 73 |
74 // Returns a single bookmark node from the argument ID. | 74 // Returns a single bookmark node from the argument ID. |
75 // This returns NULL in case of failure. | 75 // This returns NULL in case of failure. |
76 const BookmarkNode* GetNodeFromString(BookmarkModel* model, | 76 const BookmarkNode* GetNodeFromString(BookmarkModel* model, |
77 const std::string& id_string) { | 77 const std::string& id_string) { |
78 int64 id; | 78 int64 id; |
79 if (!base::StringToInt64(id_string, &id)) | 79 if (!base::StringToInt64(id_string, &id)) |
80 return NULL; | 80 return NULL; |
81 return bookmarks::GetBookmarkNodeByID(model, id); | 81 return bookmarks::GetBookmarkNodeByID(model, id); |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 | 835 |
836 enhanced_bookmarks::EnhancedBookmarkModel* model = | 836 enhanced_bookmarks::EnhancedBookmarkModel* model = |
837 enhanced_bookmarks::EnhancedBookmarkModelFactory::GetForBrowserContext( | 837 enhanced_bookmarks::EnhancedBookmarkModelFactory::GetForBrowserContext( |
838 browser_context()); | 838 browser_context()); |
839 model->SetVersionSuffix(params->version); | 839 model->SetVersionSuffix(params->version); |
840 | 840 |
841 return true; | 841 return true; |
842 } | 842 } |
843 | 843 |
844 } // namespace extensions | 844 } // namespace extensions |
OLD | NEW |