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 <AppKit/AppKit.h> | 5 #import <AppKit/AppKit.h> |
6 | 6 |
7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #import "chrome/browser/app_controller_mac.h" | 9 #import "chrome/browser/app_controller_mac.h" |
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 void BookmarkMenuBridge::ObserveBookmarkModel() { | 195 void BookmarkMenuBridge::ObserveBookmarkModel() { |
196 BookmarkModel* model = GetBookmarkModel(); | 196 BookmarkModel* model = GetBookmarkModel(); |
197 model->AddObserver(this); | 197 model->AddObserver(this); |
198 if (model->loaded()) | 198 if (model->loaded()) |
199 BookmarkModelLoaded(model, false); | 199 BookmarkModelLoaded(model, false); |
200 } | 200 } |
201 | 201 |
202 BookmarkModel* BookmarkMenuBridge::GetBookmarkModel() { | 202 BookmarkModel* BookmarkMenuBridge::GetBookmarkModel() { |
203 if (!profile_) | 203 if (!profile_) |
204 return NULL; | 204 return NULL; |
205 return BookmarkModelFactory::GetForProfile(profile_); | 205 return BookmarkModelFactory::GetForBrowserContext(profile_); |
206 } | 206 } |
207 | 207 |
208 Profile* BookmarkMenuBridge::GetProfile() { | 208 Profile* BookmarkMenuBridge::GetProfile() { |
209 return profile_; | 209 return profile_; |
210 } | 210 } |
211 | 211 |
212 NSMenu* BookmarkMenuBridge::BookmarkMenu() { | 212 NSMenu* BookmarkMenuBridge::BookmarkMenu() { |
213 return [controller_ menu]; | 213 return [controller_ menu]; |
214 } | 214 } |
215 | 215 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 NSMenuItem* BookmarkMenuBridge::MenuItemForNode(const BookmarkNode* node) { | 362 NSMenuItem* BookmarkMenuBridge::MenuItemForNode(const BookmarkNode* node) { |
363 if (!node) | 363 if (!node) |
364 return nil; | 364 return nil; |
365 std::map<const BookmarkNode*, NSMenuItem*>::iterator it = | 365 std::map<const BookmarkNode*, NSMenuItem*>::iterator it = |
366 bookmark_nodes_.find(node); | 366 bookmark_nodes_.find(node); |
367 if (it == bookmark_nodes_.end()) | 367 if (it == bookmark_nodes_.end()) |
368 return nil; | 368 return nil; |
369 return it->second; | 369 return it->second; |
370 } | 370 } |
OLD | NEW |