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

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

Issue 2216713002: Use BookmarkModelFactory::GetForBrowserContext everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Replace in .mm files Created 4 years, 4 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 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #import "base/mac/bundle_locations.h" 9 #import "base/mac/bundle_locations.h"
10 #import "base/mac/foundation_util.h" 10 #import "base/mac/foundation_util.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 - (id)initWithBrowser:(Browser*)browser 293 - (id)initWithBrowser:(Browser*)browser
294 initialWidth:(CGFloat)initialWidth 294 initialWidth:(CGFloat)initialWidth
295 delegate:(id<BookmarkBarControllerDelegate>)delegate { 295 delegate:(id<BookmarkBarControllerDelegate>)delegate {
296 if ((self = [super initWithNibName:@"BookmarkBar" 296 if ((self = [super initWithNibName:@"BookmarkBar"
297 bundle:base::mac::FrameworkBundle()])) { 297 bundle:base::mac::FrameworkBundle()])) {
298 currentState_ = BookmarkBar::HIDDEN; 298 currentState_ = BookmarkBar::HIDDEN;
299 lastState_ = BookmarkBar::HIDDEN; 299 lastState_ = BookmarkBar::HIDDEN;
300 300
301 browser_ = browser; 301 browser_ = browser;
302 initialWidth_ = initialWidth; 302 initialWidth_ = initialWidth;
303 bookmarkModel_ = BookmarkModelFactory::GetForProfile(browser_->profile()); 303 bookmarkModel_ =
304 BookmarkModelFactory::GetForBrowserContext(browser_->profile());
304 managedBookmarkService_ = 305 managedBookmarkService_ =
305 ManagedBookmarkServiceFactory::GetForProfile(browser_->profile()); 306 ManagedBookmarkServiceFactory::GetForProfile(browser_->profile());
306 buttons_.reset([[NSMutableArray alloc] init]); 307 buttons_.reset([[NSMutableArray alloc] init]);
307 delegate_ = delegate; 308 delegate_ = delegate;
308 folderTarget_.reset( 309 folderTarget_.reset(
309 [[BookmarkFolderTarget alloc] initWithController:self 310 [[BookmarkFolderTarget alloc] initWithController:self
310 profile:browser_->profile()]); 311 profile:browser_->profile()]);
311 312
312 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 313 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
313 folderImage_.reset( 314 folderImage_.reset(
(...skipping 2775 matching lines...) Expand 10 before | Expand all | Expand 10 after
3089 - (id<BookmarkButtonControllerProtocol>)controllerForNode: 3090 - (id<BookmarkButtonControllerProtocol>)controllerForNode:
3090 (const BookmarkNode*)node { 3091 (const BookmarkNode*)node {
3091 // See if it's in the bar, then if it is in the hierarchy of visible 3092 // See if it's in the bar, then if it is in the hierarchy of visible
3092 // folder menus. 3093 // folder menus.
3093 if (bookmarkModel_->bookmark_bar_node() == node) 3094 if (bookmarkModel_->bookmark_bar_node() == node)
3094 return self; 3095 return self;
3095 return [folderController_ controllerForNode:node]; 3096 return [folderController_ controllerForNode:node];
3096 } 3097 }
3097 3098
3098 @end 3099 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698