diff options
author | rfevang <rfevang@chromium.org> | 2014-09-19 15:06:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-19 22:06:52 +0000 |
commit | f7a91481ccc179cb47494c3ada5d89b4941e17dd (patch) | |
tree | d28749fd6915e88ed7c3fcb7cdae73a9b03354bf /components/enhanced_bookmarks/enhanced_bookmark_model_observer.h | |
parent | f75586adc8cbec278d71b9177b5c91c91146d200 (diff) | |
download | chromium_src-f7a91481ccc179cb47494c3ada5d89b4941e17dd.zip chromium_src-f7a91481ccc179cb47494c3ada5d89b4941e17dd.tar.gz chromium_src-f7a91481ccc179cb47494c3ada5d89b4941e17dd.tar.bz2 |
Only set remote id during url node creation.
Folders should only have their id set by the server, and the clients
should only set the remote id on clips they created themselves.
Additionally, EnhancedBookmarkModel now monitors the remote id field for bookmarks, and initiates a de-duping protocol whenever two (or more) nodes with the same id are detected.
BUG=413876
Review URL: https://codereview.chromium.org/563363002
Cr-Commit-Position: refs/heads/master@{#295790}
Diffstat (limited to 'components/enhanced_bookmarks/enhanced_bookmark_model_observer.h')
-rw-r--r-- | components/enhanced_bookmarks/enhanced_bookmark_model_observer.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/components/enhanced_bookmarks/enhanced_bookmark_model_observer.h b/components/enhanced_bookmarks/enhanced_bookmark_model_observer.h new file mode 100644 index 0000000..5ebfa16 --- /dev/null +++ b/components/enhanced_bookmarks/enhanced_bookmark_model_observer.h @@ -0,0 +1,43 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_MODEL_OBSERVER_H_ +#define COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_MODEL_OBSERVER_H_ + +#include <string> + +class BookmarkNode; + +namespace enhanced_bookmarks { + +class EnhancedBookmarkModelObserver { + public: + // Called when the model has finished loading. + virtual void EnhancedBookmarkModelLoaded() = 0; + + // Called from EnhancedBookmarkModel::ShutDown. + virtual void EnhancedBookmarkModelShuttingDown() = 0; + + // Called when a node is added to the model. + virtual void EnhancedBookmarkAdded(const BookmarkNode* node) = 0; + + // Called when a node is removed from the model. + virtual void EnhancedBookmarkRemoved(const BookmarkNode* node) = 0; + + // Called when all user editable nodes are removed from the model. + virtual void EnhancedBookmarkAllUserNodesRemoved() = 0; + + // Called when the remote id of a node changes. If |remote_id| is empty, the + // remote id has been cleared. This could happen if multiple nodes with the + // same remote id has been detected. + virtual void EnhancedBookmarkRemoteIdChanged(const BookmarkNode* node, + const std::string& old_remote_id, + const std::string& remote_id) {}; + + protected: + virtual ~EnhancedBookmarkModelObserver() {} +}; + +} // namespace enhanced_bookmarks +#endif // COMPONENTS_ENHANCED_BOOKMARKS_ENHANCED_BOOKMARK_MODEL_OBSERVER_H_ |