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 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" | 5 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "chrome/browser/bookmarks/bookmark_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_model.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sync/profile_sync_factory.h" | 10 #include "chrome/browser/sync/profile_sync_factory.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 return true; // Continue to Associate(). | 36 return true; // Continue to Associate(). |
37 } | 37 } |
38 | 38 |
39 // Add an observer and continue when the bookmarks model is loaded. | 39 // Add an observer and continue when the bookmarks model is loaded. |
40 registrar_.Add(this, NotificationType::BOOKMARK_MODEL_LOADED, | 40 registrar_.Add(this, NotificationType::BOOKMARK_MODEL_LOADED, |
41 Source<Profile>(sync_service_->profile())); | 41 Source<Profile>(sync_service_->profile())); |
42 return false; // Don't continue Start. | 42 return false; // Don't continue Start. |
43 } | 43 } |
44 | 44 |
45 // Cleanup for our extra registrar usage. | 45 // Cleanup for our extra registrar usage. |
46 void BookmarkDataTypeController::CleanupState() { | 46 void BookmarkDataTypeController::CleanUpState() { |
47 registrar_.RemoveAll(); | 47 registrar_.RemoveAll(); |
48 } | 48 } |
49 | 49 |
50 void BookmarkDataTypeController::Observe(NotificationType type, | 50 void BookmarkDataTypeController::Observe(NotificationType type, |
51 const NotificationSource& source, | 51 const NotificationSource& source, |
52 const NotificationDetails& details) { | 52 const NotificationDetails& details) { |
53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
54 DCHECK_EQ(NotificationType::BOOKMARK_MODEL_LOADED, type.value); | 54 DCHECK_EQ(NotificationType::BOOKMARK_MODEL_LOADED, type.value); |
55 registrar_.RemoveAll(); | 55 registrar_.RemoveAll(); |
56 DCHECK_EQ(state_, MODEL_STARTING); | 56 DCHECK_EQ(state_, MODEL_STARTING); |
(...skipping 22 matching lines...) Expand all Loading... |
79 UMA_HISTOGRAM_TIMES("Sync.BookmarkAssociationTime", time); | 79 UMA_HISTOGRAM_TIMES("Sync.BookmarkAssociationTime", time); |
80 } | 80 } |
81 | 81 |
82 void BookmarkDataTypeController::RecordStartFailure(StartResult result) { | 82 void BookmarkDataTypeController::RecordStartFailure(StartResult result) { |
83 UMA_HISTOGRAM_ENUMERATION("Sync.BookmarkStartFailures", | 83 UMA_HISTOGRAM_ENUMERATION("Sync.BookmarkStartFailures", |
84 result, | 84 result, |
85 MAX_START_RESULT); | 85 MAX_START_RESULT); |
86 } | 86 } |
87 | 87 |
88 } // namespace browser_sync | 88 } // namespace browser_sync |
OLD | NEW |