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

Side by Side Diff: chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.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/applescript/bookmark_node_applescript.h" 5 #import "chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/foundation_util.h" 8 #import "base/mac/foundation_util.h"
9 #import "base/mac/scoped_nsobject.h" 9 #import "base/mac/scoped_nsobject.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 - (BookmarkModel*)bookmarkModel { 117 - (BookmarkModel*)bookmarkModel {
118 AppController* appDelegate = 118 AppController* appDelegate =
119 base::mac::ObjCCastStrict<AppController>([NSApp delegate]); 119 base::mac::ObjCCastStrict<AppController>([NSApp delegate]);
120 120
121 Profile* lastProfile = [appDelegate lastProfile]; 121 Profile* lastProfile = [appDelegate lastProfile];
122 if (!lastProfile) { 122 if (!lastProfile) {
123 AppleScript::SetError(AppleScript::errGetProfile); 123 AppleScript::SetError(AppleScript::errGetProfile);
124 return NULL; 124 return NULL;
125 } 125 }
126 126
127 BookmarkModel* model = BookmarkModelFactory::GetForProfile(lastProfile); 127 BookmarkModel* model =
128 BookmarkModelFactory::GetForBrowserContext(lastProfile);
128 if (!model->loaded()) { 129 if (!model->loaded()) {
129 AppleScript::SetError(AppleScript::errBookmarkModelLoad); 130 AppleScript::SetError(AppleScript::errBookmarkModelLoad);
130 return NULL; 131 return NULL;
131 } 132 }
132 133
133 return model; 134 return model;
134 } 135 }
135 136
136 @end 137 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698