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

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: Add startup_task_runner_service. 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
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
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/sequenced_task_runner.h"
16 #include "base/string16.h" 17 #include "base/string16.h"
17 #include "base/synchronization/lock.h" 18 #include "base/synchronization/lock.h"
18 #include "base/synchronization/waitable_event.h" 19 #include "base/synchronization/waitable_event.h"
19 #include "chrome/browser/bookmarks/bookmark_service.h" 20 #include "chrome/browser/bookmarks/bookmark_service.h"
20 #include "chrome/browser/profiles/profile_keyed_service.h" 21 #include "chrome/browser/profiles/profile_keyed_service.h"
21 #include "chrome/common/cancelable_task_tracker.h" 22 #include "chrome/common/cancelable_task_tracker.h"
22 #include "content/public/browser/notification_observer.h" 23 #include "content/public/browser/notification_observer.h"
23 #include "content/public/browser/notification_registrar.h" 24 #include "content/public/browser/notification_registrar.h"
24 #include "googleurl/src/gurl.h" 25 #include "googleurl/src/gurl.h"
25 #include "ui/base/models/tree_node_model.h" 26 #include "ui/base/models/tree_node_model.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 public ProfileKeyedService { 230 public ProfileKeyedService {
230 public: 231 public:
231 explicit BookmarkModel(Profile* profile); 232 explicit BookmarkModel(Profile* profile);
232 virtual ~BookmarkModel(); 233 virtual ~BookmarkModel();
233 234
234 // Invoked prior to destruction to release any necessary resources. 235 // Invoked prior to destruction to release any necessary resources.
235 virtual void Shutdown() OVERRIDE; 236 virtual void Shutdown() OVERRIDE;
236 237
237 // Loads the bookmarks. This is called upon creation of the 238 // Loads the bookmarks. This is called upon creation of the
238 // BookmarkModel. You need not invoke this directly. 239 // BookmarkModel. You need not invoke this directly.
239 void Load(); 240 void Load(scoped_refptr<base::SequencedTaskRunner> task_runner);
240 241
241 // Returns true if the model finished loading. 242 // Returns true if the model finished loading.
242 // This is virtual so it can be mocked. 243 // This is virtual so it can be mocked.
243 virtual bool IsLoaded() const; 244 virtual bool IsLoaded() const;
244 245
245 // Returns the root node. The 'bookmark bar' node and 'other' node are 246 // Returns the root node. The 'bookmark bar' node and 'other' node are
246 // children of the root node. 247 // children of the root node.
247 const BookmarkNode* root_node() { return &root_; } 248 const BookmarkNode* root_node() { return &root_; }
248 249
249 // Returns the 'bookmark bar' node. This is NULL until loaded. 250 // Returns the 'bookmark bar' node. This is NULL until loaded.
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 526
526 // See description of IsDoingExtensiveChanges above. 527 // See description of IsDoingExtensiveChanges above.
527 int extensive_changes_; 528 int extensive_changes_;
528 529
529 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; 530 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_;
530 531
531 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); 532 DISALLOW_COPY_AND_ASSIGN(BookmarkModel);
532 }; 533 };
533 534
534 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ 535 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698