OLD | NEW |
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 Loading... |
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 |
OLD | NEW |