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

Side by Side Diff: chrome/browser/bookmarks/bookmark_context_menu_controller.cc

Issue 10821097: 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, 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_context_menu_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" 5 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/bookmarks/bookmark_editor.h" 9 #include "chrome/browser/bookmarks/bookmark_editor.h"
10 #include "chrome/browser/bookmarks/bookmark_model.h" 10 #include "chrome/browser/bookmarks/bookmark_model.h"
11 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
11 #include "chrome/browser/bookmarks/bookmark_utils.h" 12 #include "chrome/browser/bookmarks/bookmark_utils.h"
12 #include "chrome/browser/prefs/incognito_mode_prefs.h" 13 #include "chrome/browser/prefs/incognito_mode_prefs.h"
13 #include "chrome/browser/prefs/pref_service.h" 14 #include "chrome/browser/prefs/pref_service.h"
14 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/browser_tabstrip.h" 17 #include "chrome/browser/ui/browser_tabstrip.h"
17 #include "chrome/browser/ui/chrome_pages.h" 18 #include "chrome/browser/ui/chrome_pages.h"
18 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
19 #include "content/public/browser/page_navigator.h" 20 #include "content/public/browser/page_navigator.h"
20 #include "content/public/browser/user_metrics.h" 21 #include "content/public/browser/user_metrics.h"
(...skipping 11 matching lines...) Expand all
32 PageNavigator* navigator, 33 PageNavigator* navigator,
33 const BookmarkNode* parent, 34 const BookmarkNode* parent,
34 const std::vector<const BookmarkNode*>& selection) 35 const std::vector<const BookmarkNode*>& selection)
35 : parent_window_(parent_window), 36 : parent_window_(parent_window),
36 delegate_(delegate), 37 delegate_(delegate),
37 browser_(browser), 38 browser_(browser),
38 profile_(profile), 39 profile_(profile),
39 navigator_(navigator), 40 navigator_(navigator),
40 parent_(parent), 41 parent_(parent),
41 selection_(selection), 42 selection_(selection),
42 model_(profile->GetBookmarkModel()) { 43 model_(BookmarkModelFactory::GetForProfile(profile)) {
43 DCHECK(profile_); 44 DCHECK(profile_);
44 DCHECK(model_->IsLoaded()); 45 DCHECK(model_->IsLoaded());
45 menu_model_.reset(new ui::SimpleMenuModel(this)); 46 menu_model_.reset(new ui::SimpleMenuModel(this));
46 model_->AddObserver(this); 47 model_->AddObserver(this);
47 48
48 BuildMenu(); 49 BuildMenu();
49 } 50 }
50 51
51 BookmarkContextMenuController::~BookmarkContextMenuController() { 52 BookmarkContextMenuController::~BookmarkContextMenuController() {
52 if (model_) 53 if (model_)
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 delegate_->CloseMenu(); 315 delegate_->CloseMenu();
315 } 316 }
316 317
317 bool BookmarkContextMenuController::HasURLs() const { 318 bool BookmarkContextMenuController::HasURLs() const {
318 for (size_t i = 0; i < selection_.size(); ++i) { 319 for (size_t i = 0; i < selection_.size(); ++i) {
319 if (bookmark_utils::NodeHasURLs(selection_[i])) 320 if (bookmark_utils::NodeHasURLs(selection_[i]))
320 return true; 321 return true;
321 } 322 }
322 return false; 323 return false;
323 } 324 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_context_menu_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698