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_MODEL_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <map> | 10 #include <map> |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 ~BookmarkModel() override; | 76 ~BookmarkModel() override; |
77 | 77 |
78 // KeyedService: | 78 // KeyedService: |
79 void Shutdown() override; | 79 void Shutdown() override; |
80 | 80 |
81 // Loads the bookmarks. This is called upon creation of the | 81 // Loads the bookmarks. This is called upon creation of the |
82 // BookmarkModel. You need not invoke this directly. | 82 // BookmarkModel. You need not invoke this directly. |
83 // All load operations will be executed on |io_task_runner| and the completion | 83 // All load operations will be executed on |io_task_runner| and the completion |
84 // callback will be called from |ui_task_runner|. | 84 // callback will be called from |ui_task_runner|. |
85 void Load(PrefService* pref_service, | 85 void Load(PrefService* pref_service, |
86 const std::string& accept_languages, | |
87 const base::FilePath& profile_path, | 86 const base::FilePath& profile_path, |
88 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, | 87 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, |
89 const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner); | 88 const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner); |
90 | 89 |
91 // Returns true if the model finished loading. | 90 // Returns true if the model finished loading. |
92 bool loaded() const { return loaded_; } | 91 bool loaded() const { return loaded_; } |
93 | 92 |
94 // Returns the root node. The 'bookmark bar' node and 'other' node are | 93 // Returns the root node. The 'bookmark bar' node and 'other' node are |
95 // children of the root node. | 94 // children of the root node. |
96 const BookmarkNode* root_node() const { return &root_; } | 95 const BookmarkNode* root_node() const { return &root_; } |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // Generates and returns the next node ID. | 408 // Generates and returns the next node ID. |
410 int64_t generate_next_node_id(); | 409 int64_t generate_next_node_id(); |
411 | 410 |
412 // Sets the maximum node ID to the given value. | 411 // Sets the maximum node ID to the given value. |
413 // This is used by BookmarkCodec to report the maximum ID after it's done | 412 // This is used by BookmarkCodec to report the maximum ID after it's done |
414 // decoding since during decoding codec assigns node IDs. | 413 // decoding since during decoding codec assigns node IDs. |
415 void set_next_node_id(int64_t id) { next_node_id_ = id; } | 414 void set_next_node_id(int64_t id) { next_node_id_ = id; } |
416 | 415 |
417 // Creates and returns a new BookmarkLoadDetails. It's up to the caller to | 416 // Creates and returns a new BookmarkLoadDetails. It's up to the caller to |
418 // delete the returned object. | 417 // delete the returned object. |
419 scoped_ptr<BookmarkLoadDetails> CreateLoadDetails( | 418 scoped_ptr<BookmarkLoadDetails> CreateLoadDetails(); |
420 const std::string& accept_languages); | |
421 | 419 |
422 BookmarkUndoDelegate* undo_delegate() const; | 420 BookmarkUndoDelegate* undo_delegate() const; |
423 | 421 |
424 scoped_ptr<BookmarkClient> client_; | 422 scoped_ptr<BookmarkClient> client_; |
425 | 423 |
426 // Whether the initial set of data has been loaded. | 424 // Whether the initial set of data has been loaded. |
427 bool loaded_; | 425 bool loaded_; |
428 | 426 |
429 // The root node. This contains the bookmark bar node, the 'other' node and | 427 // The root node. This contains the bookmark bar node, the 'other' node and |
430 // the mobile node as children. | 428 // the mobile node as children. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 465 |
468 BookmarkUndoDelegate* undo_delegate_; | 466 BookmarkUndoDelegate* undo_delegate_; |
469 scoped_ptr<BookmarkUndoDelegate> empty_undo_delegate_; | 467 scoped_ptr<BookmarkUndoDelegate> empty_undo_delegate_; |
470 | 468 |
471 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 469 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
472 }; | 470 }; |
473 | 471 |
474 } // namespace bookmarks | 472 } // namespace bookmarks |
475 | 473 |
476 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 474 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
OLD | NEW |