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

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

Issue 10391158: Moves methods for finding browsers to browser_finder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include fixs Created 8 years, 7 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
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_utils.h" 11 #include "chrome/browser/bookmarks/bookmark_utils.h"
12 #include "chrome/browser/prefs/incognito_mode_prefs.h" 12 #include "chrome/browser/prefs/incognito_mode_prefs.h"
13 #include "chrome/browser/prefs/pref_service.h" 13 #include "chrome/browser/prefs/pref_service.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/browser_list.h" 16 #include "chrome/browser/ui/browser_finder.h"
17 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
18 #include "content/public/browser/page_navigator.h" 18 #include "content/public/browser/page_navigator.h"
19 #include "content/public/browser/user_metrics.h" 19 #include "content/public/browser/user_metrics.h"
20 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
21 #include "ui/base/l10n/l10n_util.h" 21 #include "ui/base/l10n/l10n_util.h"
22 22
23 using content::PageNavigator; 23 using content::PageNavigator;
24 using content::UserMetricsAction; 24 using content::UserMetricsAction;
25 25
26 BookmarkContextMenuController::BookmarkContextMenuController( 26 BookmarkContextMenuController::BookmarkContextMenuController(
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 BookmarkEditor::SHOW_TREE); 190 BookmarkEditor::SHOW_TREE);
191 break; 191 break;
192 } 192 }
193 193
194 case IDC_BOOKMARK_BAR_ALWAYS_SHOW: 194 case IDC_BOOKMARK_BAR_ALWAYS_SHOW:
195 bookmark_utils::ToggleWhenVisible(profile_); 195 bookmark_utils::ToggleWhenVisible(profile_);
196 break; 196 break;
197 197
198 case IDC_BOOKMARK_MANAGER: { 198 case IDC_BOOKMARK_MANAGER: {
199 content::RecordAction(UserMetricsAction("ShowBookmarkManager")); 199 content::RecordAction(UserMetricsAction("ShowBookmarkManager"));
200 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); 200 Browser* browser = browser::FindLastActiveWithProfile(profile_);
201 if (!browser) NOTREACHED(); 201 if (!browser) NOTREACHED();
202 202
203 if (selection_.size() != 1) 203 if (selection_.size() != 1)
204 browser->OpenBookmarkManager(); 204 browser->OpenBookmarkManager();
205 else if (selection_[0]->is_folder()) 205 else if (selection_[0]->is_folder())
206 browser->OpenBookmarkManagerForNode(selection_[0]->id()); 206 browser->OpenBookmarkManagerForNode(selection_[0]->id());
207 else if (parent_) 207 else if (parent_)
208 browser->OpenBookmarkManagerForNode(parent_->id()); 208 browser->OpenBookmarkManagerForNode(parent_->id());
209 else 209 else
210 browser->OpenBookmarkManager(); 210 browser->OpenBookmarkManager();
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 delegate_->CloseMenu(); 313 delegate_->CloseMenu();
314 } 314 }
315 315
316 bool BookmarkContextMenuController::HasURLs() const { 316 bool BookmarkContextMenuController::HasURLs() const {
317 for (size_t i = 0; i < selection_.size(); ++i) { 317 for (size_t i = 0; i < selection_.size(); ++i) {
318 if (bookmark_utils::NodeHasURLs(selection_[i])) 318 if (bookmark_utils::NodeHasURLs(selection_[i]))
319 return true; 319 return true;
320 } 320 }
321 return false; 321 return false;
322 } 322 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698