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

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

Issue 11148007: views: Fix a bunch of dchecks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 8 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) 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"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 bookmark_utils::PasteFromClipboard(model, paste_target, index); 177 bookmark_utils::PasteFromClipboard(model, paste_target, index);
178 break; 178 break;
179 } 179 }
180 180
181 default: 181 default:
182 NOTREACHED(); 182 NOTREACHED();
183 } 183 }
184 } 184 }
185 185
186 bool BookmarkContextMenuControllerViews::IsItemChecked(int id) const { 186 bool BookmarkContextMenuControllerViews::IsItemChecked(int id) const {
187 DCHECK(id == IDC_BOOKMARK_BAR_ALWAYS_SHOW); 187 DCHECK_EQ(IDC_BOOKMARK_BAR_ALWAYS_SHOW, id);
akalin 2012/10/14 09:30:11 please preserve the order of the arguments (e.g.,
tfarina 2012/10/14 22:26:17 No, unless I'm wrong, Peter advocates that it's DC
188 return profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar); 188 return profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar);
189 } 189 }
190 190
191 bool BookmarkContextMenuControllerViews::IsCommandEnabled(int id) const { 191 bool BookmarkContextMenuControllerViews::IsCommandEnabled(int id) const {
192 bool is_root_node = selection_.size() == 1 && 192 bool is_root_node = selection_.size() == 1 &&
193 selection_[0]->parent() == model_->root_node(); 193 selection_[0]->parent() == model_->root_node();
194 bool can_edit = 194 bool can_edit =
195 profile_->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); 195 profile_->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled);
196 IncognitoModePrefs::Availability incognito_avail = 196 IncognitoModePrefs::Availability incognito_avail =
197 IncognitoModePrefs::GetAvailability(profile_->GetPrefs()); 197 IncognitoModePrefs::GetAvailability(profile_->GetPrefs());
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 void BookmarkContextMenuControllerViews::BookmarkModelChanged() { 313 void BookmarkContextMenuControllerViews::BookmarkModelChanged() {
314 delegate_->CloseMenu(); 314 delegate_->CloseMenu();
315 } 315 }
316 316
317 BookmarkModel* BookmarkContextMenuControllerViews::RemoveModelObserver() { 317 BookmarkModel* BookmarkContextMenuControllerViews::RemoveModelObserver() {
318 BookmarkModel* model = model_; 318 BookmarkModel* model = model_;
319 model_->RemoveObserver(this); 319 model_->RemoveObserver(this);
320 model_ = NULL; 320 model_ = NULL;
321 return model; 321 return model;
322 } 322 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698