| OLD | NEW |
| 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_CLIENT_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_ |
| 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_ | 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 namespace bookmarks { | 25 namespace bookmarks { |
| 26 | 26 |
| 27 class BookmarkModel; | 27 class BookmarkModel; |
| 28 class BookmarkNode; | 28 class BookmarkNode; |
| 29 class BookmarkPermanentNode; | 29 class BookmarkPermanentNode; |
| 30 | 30 |
| 31 // This class abstracts operations that depends on the embedder's environment, | 31 // This class abstracts operations that depends on the embedder's environment, |
| 32 // e.g. Chrome. | 32 // e.g. Chrome. |
| 33 class BookmarkClient { | 33 class BookmarkClient { |
| 34 public: | 34 public: |
| 35 // Types representing a set of BookmarkNode and a mapping from BookmarkNode | 35 // Types representing a set of BookmarkNodes and a mapping from BookmarkNode |
| 36 // to the number of time the corresponding URL has been typed by the user in | 36 // to the number of times the corresponding URL has been typed by the user in |
| 37 // the Omnibox. | 37 // the Omnibox. |
| 38 typedef std::set<const BookmarkNode*> NodeSet; | 38 using NodeSet = std::set<const BookmarkNode*>; |
| 39 typedef std::pair<const BookmarkNode*, int> NodeTypedCountPair; | 39 using NodeTypedCountPair = std::pair<const BookmarkNode*, int>; |
| 40 typedef std::vector<NodeTypedCountPair> NodeTypedCountPairs; | 40 using NodeTypedCountPairs = std::vector<NodeTypedCountPair>; |
| 41 | 41 |
| 42 virtual ~BookmarkClient() {} | 42 virtual ~BookmarkClient() {} |
| 43 | 43 |
| 44 // Called during initialization of BookmarkModel. | 44 // Called during initialization of BookmarkModel. |
| 45 virtual void Init(BookmarkModel* model); | 45 virtual void Init(BookmarkModel* model); |
| 46 | 46 |
| 47 // Returns true if the embedder favors touch icons over favicons. | 47 // Returns true if the embedder favors touch icons over favicons. |
| 48 virtual bool PreferTouchIcon(); | 48 virtual bool PreferTouchIcon(); |
| 49 | 49 |
| 50 // Requests a favicon from the history cache for the web page at |page_url|. | 50 // Requests a favicon from the history cache for the web page at |page_url|. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Returns true if this node can be edited by the user. | 91 // Returns true if this node can be edited by the user. |
| 92 // TODO(joaodasilva): the model should check this more aggressively, and | 92 // TODO(joaodasilva): the model should check this more aggressively, and |
| 93 // should give the client a means to temporarily disable those checks. | 93 // should give the client a means to temporarily disable those checks. |
| 94 // http://crbug.com/49598 | 94 // http://crbug.com/49598 |
| 95 virtual bool CanBeEditedByUser(const BookmarkNode* node) = 0; | 95 virtual bool CanBeEditedByUser(const BookmarkNode* node) = 0; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace bookmarks | 98 } // namespace bookmarks |
| 99 | 99 |
| 100 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_ | 100 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_ |
| OLD | NEW |