summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_bridge.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_bridge.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_bridge.mm16
1 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_bridge.mm b/chrome/browser/cocoa/bookmark_bar_bridge.mm
index e7ace5b..354897f 100644
--- a/chrome/browser/cocoa/bookmark_bar_bridge.mm
+++ b/chrome/browser/cocoa/bookmark_bar_bridge.mm
@@ -10,7 +10,8 @@
BookmarkBarBridge::BookmarkBarBridge(BookmarkBarController* controller,
BookmarkModel* model)
: controller_(controller),
- model_(model) {
+ model_(model),
+ batch_mode_(false) {
model_->AddObserver(this);
// Bookmark loading is async; it may may not have happened yet.
@@ -44,7 +45,9 @@ void BookmarkBarBridge::BookmarkNodeMoved(BookmarkModel* model,
void BookmarkBarBridge::BookmarkNodeAdded(BookmarkModel* model,
const BookmarkNode* parent,
int index) {
- [controller_ nodeAdded:model parent:parent index:index];
+ if (!batch_mode_) {
+ [controller_ nodeAdded:model parent:parent index:index];
+ }
}
void BookmarkBarBridge::BookmarkNodeRemoved(BookmarkModel* model,
@@ -68,3 +71,12 @@ void BookmarkBarBridge::BookmarkNodeChildrenReordered(
BookmarkModel* model, const BookmarkNode* node) {
[controller_ nodeChildrenReordered:model node:node];
}
+
+void BookmarkBarBridge::BookmarkImportBeginning(BookmarkModel* model) {
+ batch_mode_ = true;
+}
+
+void BookmarkBarBridge::BookmarkImportEnding(BookmarkModel* model) {
+ batch_mode_ = false;
+ [controller_ loaded:model];
+}