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

Side by Side Diff: components/bookmarks/browser/bookmark_utils.h

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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_ 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_ 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "base/strings/utf_offset_string_conversions.h" 12 #include "base/strings/utf_offset_string_conversions.h"
13 #include "components/bookmarks/browser/bookmark_node_data.h" 13 #include "components/bookmarks/browser/bookmark_node_data.h"
14 14
15 class BookmarkModel; 15 class BookmarkModel;
16 class BookmarkNode; 16 class BookmarkNode;
17 class GURL; 17 class GURL;
18 18
19 namespace bookmarks {
20 class BookmarkClient;
21 }
22
23 namespace user_prefs { 19 namespace user_prefs {
24 class PrefRegistrySyncable; 20 class PrefRegistrySyncable;
25 } 21 }
26 22
27 // A collection of bookmark utility functions used by various parts of the UI 23 // A collection of bookmark utility functions used by various parts of the UI
28 // that show bookmarks (bookmark manager, bookmark bar view, ...) and other 24 // that show bookmarks (bookmark manager, bookmark bar view, ...) and other
29 // systems that involve indexing and searching bookmarks. 25 // systems that involve indexing and searching bookmarks.
30 namespace bookmark_utils { 26 namespace bookmarks {
27
28 class BookmarkClient;
31 29
32 // Fields to use when finding matching bookmarks. 30 // Fields to use when finding matching bookmarks.
33 struct QueryFields { 31 struct QueryFields {
34 QueryFields(); 32 QueryFields();
35 ~QueryFields(); 33 ~QueryFields();
36 34
37 scoped_ptr<base::string16> word_phrase_query; 35 scoped_ptr<base::string16> word_phrase_query;
38 scoped_ptr<base::string16> url; 36 scoped_ptr<base::string16> url;
39 scoped_ptr<base::string16> title; 37 scoped_ptr<base::string16> title;
40 }; 38 };
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 140
143 // Returns true if all the |nodes| can be edited by the user, 141 // Returns true if all the |nodes| can be edited by the user,
144 // as determined by BookmarkClient::CanBeEditedByUser(). 142 // as determined by BookmarkClient::CanBeEditedByUser().
145 bool CanAllBeEditedByUser(bookmarks::BookmarkClient* client, 143 bool CanAllBeEditedByUser(bookmarks::BookmarkClient* client,
146 const std::vector<const BookmarkNode*>& nodes); 144 const std::vector<const BookmarkNode*>& nodes);
147 145
148 // Returns true if |url| has a bookmark in the |model| that can be edited 146 // Returns true if |url| has a bookmark in the |model| that can be edited
149 // by the user. 147 // by the user.
150 bool IsBookmarkedByUser(BookmarkModel* model, const GURL& url); 148 bool IsBookmarkedByUser(BookmarkModel* model, const GURL& url);
151 149
152 } // namespace bookmark_utils
153
154 // Returns the node with |id|, or NULL if there is no node with |id|. 150 // Returns the node with |id|, or NULL if there is no node with |id|.
155 const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id); 151 const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id);
156 152
153 } // namespace bookmarks
154
157 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_ 155 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698