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

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

Issue 10827060: Removing instances of profile_->GetBookmarkModel() as part of converting BookmarkModel to a PKS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
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 "base/mac/bundle_locations.h" 7 #include "base/mac/bundle_locations.h"
8 #include "base/mac/mac_util.h" 8 #include "base/mac/mac_util.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
11 #include "chrome/browser/bookmarks/bookmark_editor.h" 11 #include "chrome/browser/bookmarks/bookmark_editor.h"
12 #include "chrome/browser/bookmarks/bookmark_model.h" 12 #include "chrome/browser/bookmarks/bookmark_model.h"
13 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
13 #include "chrome/browser/bookmarks/bookmark_utils.h" 14 #include "chrome/browser/bookmarks/bookmark_utils.h"
14 #include "chrome/browser/extensions/extension_service.h" 15 #include "chrome/browser/extensions/extension_service.h"
15 #include "chrome/browser/prefs/incognito_mode_prefs.h" 16 #include "chrome/browser/prefs/incognito_mode_prefs.h"
16 #include "chrome/browser/prefs/pref_service.h" 17 #include "chrome/browser/prefs/pref_service.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #import "chrome/browser/themes/theme_service.h" 19 #import "chrome/browser/themes/theme_service.h"
19 #import "chrome/browser/themes/theme_service_factory.h" 20 #import "chrome/browser/themes/theme_service_factory.h"
20 #include "chrome/browser/ui/browser.h" 21 #include "chrome/browser/ui/browser.h"
21 #include "chrome/browser/ui/browser_list.h" 22 #include "chrome/browser/ui/browser_list.h"
22 #include "chrome/browser/ui/browser_tabstrip.h" 23 #include "chrome/browser/ui/browser_tabstrip.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 delegate:(id<BookmarkBarControllerDelegate>)delegate 236 delegate:(id<BookmarkBarControllerDelegate>)delegate
236 resizeDelegate:(id<ViewResizer>)resizeDelegate { 237 resizeDelegate:(id<ViewResizer>)resizeDelegate {
237 if ((self = [super initWithNibName:@"BookmarkBar" 238 if ((self = [super initWithNibName:@"BookmarkBar"
238 bundle:base::mac::FrameworkBundle()])) { 239 bundle:base::mac::FrameworkBundle()])) {
239 // Initialize to an invalid state. 240 // Initialize to an invalid state.
240 visualState_ = bookmarks::kInvalidState; 241 visualState_ = bookmarks::kInvalidState;
241 lastVisualState_ = bookmarks::kInvalidState; 242 lastVisualState_ = bookmarks::kInvalidState;
242 243
243 browser_ = browser; 244 browser_ = browser;
244 initialWidth_ = initialWidth; 245 initialWidth_ = initialWidth;
245 bookmarkModel_ = browser_->profile()->GetBookmarkModel(); 246 bookmarkModel_ = BookmarkModelFactory::GetForProfile(browser_->profile());
246 buttons_.reset([[NSMutableArray alloc] init]); 247 buttons_.reset([[NSMutableArray alloc] init]);
247 delegate_ = delegate; 248 delegate_ = delegate;
248 resizeDelegate_ = resizeDelegate; 249 resizeDelegate_ = resizeDelegate;
249 folderTarget_.reset([[BookmarkFolderTarget alloc] initWithController:self]); 250 folderTarget_.reset([[BookmarkFolderTarget alloc] initWithController:self]);
250 251
251 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 252 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
252 folderImage_.reset( 253 folderImage_.reset(
253 [rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER) retain]); 254 [rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER) retain]);
254 defaultImage_.reset([rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON) retain]); 255 defaultImage_.reset([rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON) retain]);
255 256
(...skipping 2536 matching lines...) Expand 10 before | Expand all | Expand 10 after
2792 // to minimize touching the object passed in (likely a mock). 2793 // to minimize touching the object passed in (likely a mock).
2793 - (void)setButtonContextMenu:(id)menu { 2794 - (void)setButtonContextMenu:(id)menu {
2794 buttonContextMenu_ = menu; 2795 buttonContextMenu_ = menu;
2795 } 2796 }
2796 2797
2797 - (void)setIgnoreAnimations:(BOOL)ignore { 2798 - (void)setIgnoreAnimations:(BOOL)ignore {
2798 ignoreAnimations_ = ignore; 2799 ignoreAnimations_ = ignore;
2799 } 2800 }
2800 2801
2801 @end 2802 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698