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

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

Issue 865163003: bookmarks: Move BookmarkNode into 'bookmarks' namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enhanced_bookmarks fix Created 5 years, 10 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 <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"
11 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" 11 #include "chrome/browser/bookmarks/chrome_bookmark_client.h"
12 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h" 12 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
13 #include "chrome/browser/prefs/incognito_mode_prefs.h" 13 #include "chrome/browser/prefs/incognito_mode_prefs.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
16 #include "chrome/browser/ui/browser_list.h" 16 #include "chrome/browser/ui/browser_list.h"
17 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h" 17 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h"
18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h"
19 #include "chrome/grit/generated_resources.h" 19 #include "chrome/grit/generated_resources.h"
20 #include "components/bookmarks/browser/bookmark_model.h" 20 #include "components/bookmarks/browser/bookmark_model.h"
21 #include "grit/theme_resources.h" 21 #include "grit/theme_resources.h"
22 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
24 #include "ui/gfx/image/image.h" 24 #include "ui/gfx/image/image.h"
25 #include "ui/resources/grit/ui_resources.h" 25 #include "ui/resources/grit/ui_resources.h"
26 26
27 using bookmarks::BookmarkModel; 27 using bookmarks::BookmarkModel;
28 using bookmarks::BookmarkNode;
28 29
29 BookmarkMenuBridge::BookmarkMenuBridge(Profile* profile, NSMenu* menu) 30 BookmarkMenuBridge::BookmarkMenuBridge(Profile* profile, NSMenu* menu)
30 : menuIsValid_(false), 31 : menuIsValid_(false),
31 profile_(profile), 32 profile_(profile),
32 controller_([[BookmarkMenuCocoaController alloc] initWithBridge:this 33 controller_([[BookmarkMenuCocoaController alloc] initWithBridge:this
33 andMenu:menu]) { 34 andMenu:menu]) {
34 if (GetBookmarkModel()) 35 if (GetBookmarkModel())
35 ObserveBookmarkModel(); 36 ObserveBookmarkModel();
36 } 37 }
37 38
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 353
353 NSMenuItem* BookmarkMenuBridge::MenuItemForNode(const BookmarkNode* node) { 354 NSMenuItem* BookmarkMenuBridge::MenuItemForNode(const BookmarkNode* node) {
354 if (!node) 355 if (!node)
355 return nil; 356 return nil;
356 std::map<const BookmarkNode*, NSMenuItem*>::iterator it = 357 std::map<const BookmarkNode*, NSMenuItem*>::iterator it =
357 bookmark_nodes_.find(node); 358 bookmark_nodes_.find(node);
358 if (it == bookmark_nodes_.end()) 359 if (it == bookmark_nodes_.end())
359 return nil; 360 return nil;
360 return it->second; 361 return it->second;
361 } 362 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698