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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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/ui/views/bookmarks/bookmark_context_menu_controller_vie ws.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_vie ws.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_tabstrip.h"
16 #include "chrome/browser/ui/chrome_pages.h" 17 #include "chrome/browser/ui/chrome_pages.h"
17 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
18 #include "content/public/browser/page_navigator.h" 19 #include "content/public/browser/page_navigator.h"
19 #include "content/public/browser/user_metrics.h" 20 #include "content/public/browser/user_metrics.h"
20 #include "grit/generated_resources.h" 21 #include "grit/generated_resources.h"
21 #include "ui/views/widget/widget.h" 22 #include "ui/views/widget/widget.h"
22 23
23 using content::PageNavigator; 24 using content::PageNavigator;
24 using content::UserMetricsAction; 25 using content::UserMetricsAction;
25 26
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 case IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK: { 108 case IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK: {
108 content::RecordAction( 109 content::RecordAction(
109 UserMetricsAction("BookmarkBar_ContextMenu_Add")); 110 UserMetricsAction("BookmarkBar_ContextMenu_Add"));
110 111
111 int index; 112 int index;
112 const BookmarkNode* parent = 113 const BookmarkNode* parent =
113 bookmark_utils::GetParentForNewNodes(parent_, selection_, &index); 114 bookmark_utils::GetParentForNewNodes(parent_, selection_, &index);
114 GURL url; 115 GURL url;
115 string16 title; 116 string16 title;
116 bookmark_utils::GetURLAndTitleToBookmark( 117 bookmark_utils::GetURLAndTitleToBookmark(
117 browser_->GetActiveWebContents(), &url, &title); 118 chrome::GetActiveWebContents(browser_), &url, &title);
118 BookmarkEditor::Show( 119 BookmarkEditor::Show(
119 parent_widget_->GetNativeWindow(), 120 parent_widget_->GetNativeWindow(),
120 profile_, 121 profile_,
121 BookmarkEditor::EditDetails::AddNodeInFolder( 122 BookmarkEditor::EditDetails::AddNodeInFolder(
122 parent, index, url, title), 123 parent, index, url, title),
123 BookmarkEditor::SHOW_TREE); 124 BookmarkEditor::SHOW_TREE);
124 break; 125 break;
125 } 126 }
126 127
127 case IDC_BOOKMARK_BAR_NEW_FOLDER: { 128 case IDC_BOOKMARK_BAR_NEW_FOLDER: {
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 return model; 325 return model;
325 } 326 }
326 327
327 bool BookmarkContextMenuControllerViews::HasURLs() const { 328 bool BookmarkContextMenuControllerViews::HasURLs() const {
328 for (size_t i = 0; i < selection_.size(); ++i) { 329 for (size_t i = 0; i < selection_.size(); ++i) {
329 if (bookmark_utils::NodeHasURLs(selection_[i])) 330 if (bookmark_utils::NodeHasURLs(selection_[i]))
330 return true; 331 return true;
331 } 332 }
332 return false; 333 return false;
333 } 334 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc ('k') | chrome/browser/ui/views/browser_actions_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698