| 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 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_BOOKMARKS_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_BOOKMARKS_HELPER_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_BOOKMARKS_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_BOOKMARKS_HELPER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // Used to access the "Synced Bookmarks" node within a particular sync profile. | 31 // Used to access the "Synced Bookmarks" node within a particular sync profile. |
| 32 const BookmarkNode* GetSyncedBookmarksNode(int index) WARN_UNUSED_RESULT; | 32 const BookmarkNode* GetSyncedBookmarksNode(int index) WARN_UNUSED_RESULT; |
| 33 | 33 |
| 34 // Used to access the bookmarks within the verifier sync profile. | 34 // Used to access the bookmarks within the verifier sync profile. |
| 35 BookmarkModel* GetVerifierBookmarkModel() WARN_UNUSED_RESULT; | 35 BookmarkModel* GetVerifierBookmarkModel() WARN_UNUSED_RESULT; |
| 36 | 36 |
| 37 // Adds a URL with address |url| and title |title| to the bookmark bar of | 37 // Adds a URL with address |url| and title |title| to the bookmark bar of |
| 38 // profile |profile|. Returns a pointer to the node that was added. | 38 // profile |profile|. Returns a pointer to the node that was added. |
| 39 const BookmarkNode* AddURL( | 39 const BookmarkNode* AddURL( |
| 40 int profile, | 40 int profile, |
| 41 const std::wstring& title, | 41 const std::string& title, |
| 42 const GURL& url) WARN_UNUSED_RESULT; | 42 const GURL& url) WARN_UNUSED_RESULT; |
| 43 | 43 |
| 44 // Adds a URL with address |url| and title |title| to the bookmark bar of | 44 // Adds a URL with address |url| and title |title| to the bookmark bar of |
| 45 // profile |profile| at position |index|. Returns a pointer to the node that | 45 // profile |profile| at position |index|. Returns a pointer to the node that |
| 46 // was added. | 46 // was added. |
| 47 const BookmarkNode* AddURL( | 47 const BookmarkNode* AddURL( |
| 48 int profile, | 48 int profile, |
| 49 int index, | 49 int index, |
| 50 const std::wstring& title, | 50 const std::string& title, |
| 51 const GURL& url) WARN_UNUSED_RESULT; | 51 const GURL& url) WARN_UNUSED_RESULT; |
| 52 | 52 |
| 53 // Adds a URL with address |url| and title |title| under the node |parent| of | 53 // Adds a URL with address |url| and title |title| under the node |parent| of |
| 54 // profile |profile| at position |index|. Returns a pointer to the node that | 54 // profile |profile| at position |index|. Returns a pointer to the node that |
| 55 // was added. | 55 // was added. |
| 56 const BookmarkNode* AddURL( | 56 const BookmarkNode* AddURL( |
| 57 int profile, | 57 int profile, |
| 58 const BookmarkNode* parent, | 58 const BookmarkNode* parent, |
| 59 int index, | 59 int index, |
| 60 const std::wstring& title, | 60 const std::string& title, |
| 61 const GURL& url) WARN_UNUSED_RESULT; | 61 const GURL& url) WARN_UNUSED_RESULT; |
| 62 | 62 |
| 63 // Adds a folder named |title| to the bookmark bar of profile |profile|. | 63 // Adds a folder named |title| to the bookmark bar of profile |profile|. |
| 64 // Returns a pointer to the folder that was added. | 64 // Returns a pointer to the folder that was added. |
| 65 const BookmarkNode* AddFolder( | 65 const BookmarkNode* AddFolder( |
| 66 int profile, | 66 int profile, |
| 67 const std::wstring& title) WARN_UNUSED_RESULT; | 67 const std::string& title) WARN_UNUSED_RESULT; |
| 68 | 68 |
| 69 // Adds a folder named |title| to the bookmark bar of profile |profile| at | 69 // Adds a folder named |title| to the bookmark bar of profile |profile| at |
| 70 // position |index|. Returns a pointer to the folder that was added. | 70 // position |index|. Returns a pointer to the folder that was added. |
| 71 const BookmarkNode* AddFolder( | 71 const BookmarkNode* AddFolder( |
| 72 int profile, | 72 int profile, |
| 73 int index, | 73 int index, |
| 74 const std::wstring& title) WARN_UNUSED_RESULT; | 74 const std::string& title) WARN_UNUSED_RESULT; |
| 75 | 75 |
| 76 // Adds a folder named |title| to the node |parent| in the bookmark model of | 76 // Adds a folder named |title| to the node |parent| in the bookmark model of |
| 77 // profile |profile| at position |index|. Returns a pointer to the node that | 77 // profile |profile| at position |index|. Returns a pointer to the node that |
| 78 // was added. | 78 // was added. |
| 79 const BookmarkNode* AddFolder( | 79 const BookmarkNode* AddFolder( |
| 80 int profile, | 80 int profile, |
| 81 const BookmarkNode* parent, | 81 const BookmarkNode* parent, |
| 82 int index, | 82 int index, |
| 83 const std::wstring& title) WARN_UNUSED_RESULT; | 83 const std::string& title) WARN_UNUSED_RESULT; |
| 84 | 84 |
| 85 // Changes the title of the node |node| in the bookmark model of profile | 85 // Changes the title of the node |node| in the bookmark model of profile |
| 86 // |profile| to |new_title|. | 86 // |profile| to |new_title|. |
| 87 void SetTitle(int profile, | 87 void SetTitle(int profile, |
| 88 const BookmarkNode* node, | 88 const BookmarkNode* node, |
| 89 const std::wstring& new_title); | 89 const std::string& new_title); |
| 90 | 90 |
| 91 // The source of the favicon. | 91 // The source of the favicon. |
| 92 enum FaviconSource { | 92 enum FaviconSource { |
| 93 FROM_UI, | 93 FROM_UI, |
| 94 FROM_SYNC | 94 FROM_SYNC |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 // Sets the |icon_url| and |image| data for the favicon for |node| in the | 97 // Sets the |icon_url| and |image| data for the favicon for |node| in the |
| 98 // bookmark model for |profile|. | 98 // bookmark model for |profile|. |
| 99 void SetFavicon(int profile, | 99 void SetFavicon(int profile, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // Gets the node in the bookmark model of profile |profile| that has the url | 165 // Gets the node in the bookmark model of profile |profile| that has the url |
| 166 // |url|. Note: Only one instance of |url| is assumed to be present. | 166 // |url|. Note: Only one instance of |url| is assumed to be present. |
| 167 const BookmarkNode* GetUniqueNodeByURL( | 167 const BookmarkNode* GetUniqueNodeByURL( |
| 168 int profile, | 168 int profile, |
| 169 const GURL& url) WARN_UNUSED_RESULT; | 169 const GURL& url) WARN_UNUSED_RESULT; |
| 170 | 170 |
| 171 // Returns the number of bookmarks in bookmark model of profile |profile| | 171 // Returns the number of bookmarks in bookmark model of profile |profile| |
| 172 // whose titles match the string |title|. | 172 // whose titles match the string |title|. |
| 173 int CountBookmarksWithTitlesMatching( | 173 int CountBookmarksWithTitlesMatching( |
| 174 int profile, | 174 int profile, |
| 175 const std::wstring& title) WARN_UNUSED_RESULT; | 175 const std::string& title) WARN_UNUSED_RESULT; |
| 176 | 176 |
| 177 // Returns the number of bookmark folders in the bookmark model of profile | 177 // Returns the number of bookmark folders in the bookmark model of profile |
| 178 // |profile| whose titles contain the query string |title|. | 178 // |profile| whose titles contain the query string |title|. |
| 179 int CountFoldersWithTitlesMatching( | 179 int CountFoldersWithTitlesMatching( |
| 180 int profile, | 180 int profile, |
| 181 const std::wstring& title) WARN_UNUSED_RESULT; | 181 const std::string& title) WARN_UNUSED_RESULT; |
| 182 | 182 |
| 183 // Creates a favicon of |color| with image reps of the platform's supported | 183 // Creates a favicon of |color| with image reps of the platform's supported |
| 184 // scale factors (eg MacOS) in addition to 1x. | 184 // scale factors (eg MacOS) in addition to 1x. |
| 185 gfx::Image CreateFavicon(SkColor color); | 185 gfx::Image CreateFavicon(SkColor color); |
| 186 | 186 |
| 187 // Creates a 1x only favicon from the PNG file at |path|. | 187 // Creates a 1x only favicon from the PNG file at |path|. |
| 188 gfx::Image Create1xFaviconFromPNGFile(const std::string& path); | 188 gfx::Image Create1xFaviconFromPNGFile(const std::string& path); |
| 189 | 189 |
| 190 // Returns a URL identifiable by |i|. | 190 // Returns a URL identifiable by |i|. |
| 191 std::string IndexedURL(int i); | 191 std::string IndexedURL(int i); |
| 192 | 192 |
| 193 // Returns a URL title identifiable by |i|. | 193 // Returns a URL title identifiable by |i|. |
| 194 std::wstring IndexedURLTitle(int i); | 194 std::string IndexedURLTitle(int i); |
| 195 | 195 |
| 196 // Returns a folder name identifiable by |i|. | 196 // Returns a folder name identifiable by |i|. |
| 197 std::wstring IndexedFolderName(int i); | 197 std::string IndexedFolderName(int i); |
| 198 | 198 |
| 199 // Returns a subfolder name identifiable by |i|. | 199 // Returns a subfolder name identifiable by |i|. |
| 200 std::wstring IndexedSubfolderName(int i); | 200 std::string IndexedSubfolderName(int i); |
| 201 | 201 |
| 202 // Returns a subsubfolder name identifiable by |i|. | 202 // Returns a subsubfolder name identifiable by |i|. |
| 203 std::wstring IndexedSubsubfolderName(int i); | 203 std::string IndexedSubsubfolderName(int i); |
| 204 | 204 |
| 205 } // namespace bookmarks_helper | 205 } // namespace bookmarks_helper |
| 206 | 206 |
| 207 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_BOOKMARKS_HELPER_H_ | 207 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_BOOKMARKS_HELPER_H_ |
| OLD | NEW |