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

Side by Side Diff: chrome/browser/bookmarks/bookmark_model.h

Issue 12952005: Delay bookmarks load while the profile is loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment. Created 7 years, 8 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
« no previous file with comments | « chrome/browser/bookmarks/DEPS ('k') | chrome/browser/bookmarks/bookmark_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_BOOKMARKS_BOOKMARK_MODEL_H_ 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 15 matching lines...) Expand all
26 #include "ui/gfx/image/image.h" 26 #include "ui/gfx/image/image.h"
27 27
28 class BookmarkExpandedStateTracker; 28 class BookmarkExpandedStateTracker;
29 class BookmarkIndex; 29 class BookmarkIndex;
30 class BookmarkLoadDetails; 30 class BookmarkLoadDetails;
31 class BookmarkModel; 31 class BookmarkModel;
32 class BookmarkModelObserver; 32 class BookmarkModelObserver;
33 class BookmarkStorage; 33 class BookmarkStorage;
34 class Profile; 34 class Profile;
35 35
36 namespace base {
37 class SequencedTaskRunner;
38 }
39
36 namespace bookmark_utils { 40 namespace bookmark_utils {
37 struct TitleMatch; 41 struct TitleMatch;
38 } 42 }
39 43
40 namespace history { 44 namespace history {
41 struct FaviconImageResult; 45 struct FaviconImageResult;
42 } 46 }
43 47
44 // BookmarkNode --------------------------------------------------------------- 48 // BookmarkNode ---------------------------------------------------------------
45 49
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 public ProfileKeyedService { 233 public ProfileKeyedService {
230 public: 234 public:
231 explicit BookmarkModel(Profile* profile); 235 explicit BookmarkModel(Profile* profile);
232 virtual ~BookmarkModel(); 236 virtual ~BookmarkModel();
233 237
234 // Invoked prior to destruction to release any necessary resources. 238 // Invoked prior to destruction to release any necessary resources.
235 virtual void Shutdown() OVERRIDE; 239 virtual void Shutdown() OVERRIDE;
236 240
237 // Loads the bookmarks. This is called upon creation of the 241 // Loads the bookmarks. This is called upon creation of the
238 // BookmarkModel. You need not invoke this directly. 242 // BookmarkModel. You need not invoke this directly.
239 void Load(); 243 // All load operations will be executed on |task_runner|.
244 void Load(const scoped_refptr<base::SequencedTaskRunner>& task_runner);
240 245
241 // Returns true if the model finished loading. 246 // Returns true if the model finished loading.
242 // This is virtual so it can be mocked. 247 // This is virtual so it can be mocked.
243 virtual bool IsLoaded() const; 248 virtual bool IsLoaded() const;
244 249
245 // Returns the root node. The 'bookmark bar' node and 'other' node are 250 // Returns the root node. The 'bookmark bar' node and 'other' node are
246 // children of the root node. 251 // children of the root node.
247 const BookmarkNode* root_node() { return &root_; } 252 const BookmarkNode* root_node() { return &root_; }
248 253
249 // Returns the 'bookmark bar' node. This is NULL until loaded. 254 // Returns the 'bookmark bar' node. This is NULL until loaded.
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 544
540 // See description of IsDoingExtensiveChanges above. 545 // See description of IsDoingExtensiveChanges above.
541 int extensive_changes_; 546 int extensive_changes_;
542 547
543 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; 548 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_;
544 549
545 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); 550 DISALLOW_COPY_AND_ASSIGN(BookmarkModel);
546 }; 551 };
547 552
548 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ 553 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/DEPS ('k') | chrome/browser/bookmarks/bookmark_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698