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

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

Issue 8135001: Fixed behavior of the bookmark bar visibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK_EQ instead of DCHECK Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_folder_editor_controller.h" 10 #include "chrome/browser/bookmarks/bookmark_folder_editor_controller.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 case IDC_BOOKMARK_BAR_REMOVE: 261 case IDC_BOOKMARK_BAR_REMOVE:
262 return !selection_.empty() && !is_root_node && can_edit; 262 return !selection_.empty() && !is_root_node && can_edit;
263 263
264 case IDC_BOOKMARK_BAR_NEW_FOLDER: 264 case IDC_BOOKMARK_BAR_NEW_FOLDER:
265 case IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK: 265 case IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK:
266 return can_edit && bookmark_utils::GetParentForNewNodes( 266 return can_edit && bookmark_utils::GetParentForNewNodes(
267 parent_, selection_, NULL) != NULL; 267 parent_, selection_, NULL) != NULL;
268 268
269 case IDC_BOOKMARK_BAR_ALWAYS_SHOW: 269 case IDC_BOOKMARK_BAR_ALWAYS_SHOW:
270 return !profile_->GetPrefs()->IsManagedPreference( 270 return !profile_->GetPrefs()->IsManagedPreference(
271 prefs::kEnableBookmarkBar); 271 prefs::kShowBookmarkBar);
272 272
273 case IDC_COPY: 273 case IDC_COPY:
274 case IDC_CUT: 274 case IDC_CUT:
275 return !selection_.empty() && !is_root_node && 275 return !selection_.empty() && !is_root_node &&
276 (id == IDC_COPY || can_edit); 276 (id == IDC_COPY || can_edit);
277 277
278 case IDC_PASTE: 278 case IDC_PASTE:
279 // Paste to selection from the Bookmark Bar, to parent_ everywhere else 279 // Paste to selection from the Bookmark Bar, to parent_ everywhere else
280 return can_edit && 280 return can_edit &&
281 ((!selection_.empty() && 281 ((!selection_.empty() &&
(...skipping 14 matching lines...) Expand all
296 return model; 296 return model;
297 } 297 }
298 298
299 bool BookmarkContextMenuControllerViews::HasURLs() const { 299 bool BookmarkContextMenuControllerViews::HasURLs() const {
300 for (size_t i = 0; i < selection_.size(); ++i) { 300 for (size_t i = 0; i < selection_.size(); ++i) {
301 if (bookmark_utils::NodeHasURLs(selection_[i])) 301 if (bookmark_utils::NodeHasURLs(selection_[i]))
302 return true; 302 return true;
303 } 303 }
304 return false; 304 return false;
305 } 305 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.h ('k') | chrome/browser/ui/webui/chrome_web_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698