Index: chrome/browser/bookmarks/scoped_group_bookmark_actions.cc |
diff --git a/chrome/browser/bookmarks/scoped_group_bookmark_actions.cc b/chrome/browser/bookmarks/scoped_group_bookmark_actions.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ab3fc6a120a22d37008dd6d383cd1527cebdb16b |
--- /dev/null |
+++ b/chrome/browser/bookmarks/scoped_group_bookmark_actions.cc |
@@ -0,0 +1,27 @@ |
+// Copyright (c) 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. |
+ |
+#include "chrome/browser/bookmarks/scoped_group_bookmark_actions.h" |
+ |
+#include "chrome/browser/bookmarks/bookmark_model.h" |
+#include "chrome/browser/bookmarks/bookmark_model_factory.h" |
+ |
+ScopedGroupBookmarkActions::ScopedGroupBookmarkActions(Profile* profile) |
+ : model_(NULL) { |
+ if (profile) |
+ model_ = BookmarkModelFactory::GetForProfile(profile); |
+ if (model_) |
+ model_->BeginGroupedChanges(); |
+} |
+ |
+ScopedGroupBookmarkActions::ScopedGroupBookmarkActions(BookmarkModel* model) |
+ : model_(model) { |
+ if (model_) |
+ model_->BeginGroupedChanges(); |
+} |
+ |
+ScopedGroupBookmarkActions::~ScopedGroupBookmarkActions() { |
+ if (model_) |
+ model_->EndGroupedChanges(); |
+} |