Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(735)

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm

Issue 2751573002: [Mac] Refactor bookmark bar controller (Closed)
Patch Set: Restore unused button pool Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/cocoa/bookmarks/bookmark_bar_bridge.h" 5 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" 9 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
10 #include "components/bookmarks/browser/bookmark_model.h" 10 #include "components/bookmarks/browser/bookmark_model.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 BookmarkBarBridge::~BookmarkBarBridge() { 43 BookmarkBarBridge::~BookmarkBarBridge() {
44 if (model_) 44 if (model_)
45 model_->RemoveObserver(this); 45 model_->RemoveObserver(this);
46 } 46 }
47 47
48 void BookmarkBarBridge::BookmarkModelLoaded(BookmarkModel* model, 48 void BookmarkBarBridge::BookmarkModelLoaded(BookmarkModel* model,
49 bool ids_reassigned) { 49 bool ids_reassigned) {
50 [controller_ loaded:model]; 50 [controller_ loaded:model];
51 } 51 }
52 52
53 void BookmarkBarBridge::BookmarkModelBeingDeleted(BookmarkModel* model) { 53 void BookmarkBarBridge::BookmarkModelBeingDeleted(BookmarkModel* model) {
Elly Fong-Jones 2017/03/23 15:40:21 can this happen in other circumstances than the br
54 [controller_ beingDeleted:model];
55 model_->RemoveObserver(this); 54 model_->RemoveObserver(this);
56 model_ = nullptr; 55 model_ = nullptr;
56 // The browser may be being torn down; little is safe to do. As an
57 // example, it may not be safe to clear the pasteboard.
58 // http://crbug.com/38665
57 } 59 }
58 60
59 void BookmarkBarBridge::BookmarkNodeMoved(BookmarkModel* model, 61 void BookmarkBarBridge::BookmarkNodeMoved(BookmarkModel* model,
60 const BookmarkNode* old_parent, 62 const BookmarkNode* old_parent,
61 int old_index, 63 int old_index,
62 const BookmarkNode* new_parent, 64 const BookmarkNode* new_parent,
63 int new_index) { 65 int new_index) {
64 if (!batch_mode_) { 66 if (!batch_mode_) {
65 [controller_ nodeMoved:model 67 [controller_ nodeMoved:model
66 oldParent:old_parent oldIndex:old_index 68 oldParent:old_parent oldIndex:old_index
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 117 }
116 118
117 void BookmarkBarBridge::ExtensiveBookmarkChangesEnded(BookmarkModel* model) { 119 void BookmarkBarBridge::ExtensiveBookmarkChangesEnded(BookmarkModel* model) {
118 batch_mode_ = false; 120 batch_mode_ = false;
119 [controller_ loaded:model]; 121 [controller_ loaded:model];
120 } 122 }
121 123
122 void BookmarkBarBridge::OnExtraButtonsVisibilityChanged() { 124 void BookmarkBarBridge::OnExtraButtonsVisibilityChanged() {
123 [controller_ updateExtraButtonsVisibility]; 125 [controller_ updateExtraButtonsVisibility];
124 } 126 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698