| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 15 #include "base/string16.h" | 17 #include "base/string16.h" |
| 16 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 17 #include "base/synchronization/waitable_event.h" | 19 #include "base/synchronization/waitable_event.h" |
| 18 #include "chrome/browser/bookmarks/bookmark_service.h" | 20 #include "chrome/browser/bookmarks/bookmark_service.h" |
| 19 #include "chrome/browser/favicon/favicon_service.h" | 21 #include "chrome/browser/favicon/favicon_service.h" |
| 20 #include "chrome/browser/history/history.h" | 22 #include "chrome/browser/history/history.h" |
| 23 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 21 #include "content/browser/cancelable_request.h" | 24 #include "content/browser/cancelable_request.h" |
| 22 #include "content/common/notification_registrar.h" | 25 #include "content/common/notification_registrar.h" |
| 23 #include "googleurl/src/gurl.h" | 26 #include "googleurl/src/gurl.h" |
| 24 #include "third_party/skia/include/core/SkBitmap.h" | 27 #include "third_party/skia/include/core/SkBitmap.h" |
| 25 #include "ui/base/models/tree_node_model.h" | 28 #include "ui/base/models/tree_node_model.h" |
| 26 | 29 |
| 27 class BookmarkExpandedStateTracker; | 30 class BookmarkExpandedStateTracker; |
| 28 class BookmarkIndex; | 31 class BookmarkIndex; |
| 29 class BookmarkLoadDetails; | 32 class BookmarkLoadDetails; |
| 30 class BookmarkModel; | 33 class BookmarkModel; |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 413 |
| 411 // Records that the bookmarks file was changed externally. | 414 // Records that the bookmarks file was changed externally. |
| 412 void SetFileChanged(); | 415 void SetFileChanged(); |
| 413 | 416 |
| 414 // Creates and returns a new BookmarkLoadDetails. It's up to the caller to | 417 // Creates and returns a new BookmarkLoadDetails. It's up to the caller to |
| 415 // delete the returned object. | 418 // delete the returned object. |
| 416 BookmarkLoadDetails* CreateLoadDetails(); | 419 BookmarkLoadDetails* CreateLoadDetails(); |
| 417 | 420 |
| 418 NotificationRegistrar registrar_; | 421 NotificationRegistrar registrar_; |
| 419 | 422 |
| 423 // Listens for changes to the kShowBookmarkBar preference. |
| 424 PrefChangeRegistrar pref_change_registrar_; |
| 425 |
| 420 Profile* profile_; | 426 Profile* profile_; |
| 421 | 427 |
| 422 // Whether the initial set of data has been loaded. | 428 // Whether the initial set of data has been loaded. |
| 423 bool loaded_; | 429 bool loaded_; |
| 424 | 430 |
| 425 // Whether the bookmarks file was changed externally. This is set after | 431 // Whether the bookmarks file was changed externally. This is set after |
| 426 // loading is complete and once set the value never changes. | 432 // loading is complete and once set the value never changes. |
| 427 bool file_changed_; | 433 bool file_changed_; |
| 428 | 434 |
| 429 // The root node. This contains the bookmark bar node and the 'other' node as | 435 // The root node. This contains the bookmark bar node and the 'other' node as |
| (...skipping 27 matching lines...) Expand all Loading... |
| 457 scoped_ptr<BookmarkIndex> index_; | 463 scoped_ptr<BookmarkIndex> index_; |
| 458 | 464 |
| 459 base::WaitableEvent loaded_signal_; | 465 base::WaitableEvent loaded_signal_; |
| 460 | 466 |
| 461 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; | 467 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; |
| 462 | 468 |
| 463 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 469 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
| 464 }; | 470 }; |
| 465 | 471 |
| 466 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ | 472 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MODEL_H_ |
| OLD | NEW |