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

Side by Side Diff: chrome/browser/ui/views/bookmark_menu_controller_views.cc

Issue 6452011: Rework tree APIs to reflect Google style and more const-correctness.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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/bookmark_menu_controller_views.h" 5 #include "chrome/browser/ui/views/bookmark_menu_controller_views.h"
6 6
7 #include "base/stl_util-inl.h" 7 #include "base/stl_util-inl.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/bookmarks/bookmark_node_data.h" 9 #include "chrome/browser/bookmarks/bookmark_node_data.h"
10 #include "chrome/browser/bookmarks/bookmark_model.h" 10 #include "chrome/browser/bookmarks/bookmark_model.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 std::set<MenuItemView*> changed_parent_menus; 381 std::set<MenuItemView*> changed_parent_menus;
382 for (std::vector<const BookmarkNode*>::const_iterator i = bookmarks.begin(); 382 for (std::vector<const BookmarkNode*>::const_iterator i = bookmarks.begin();
383 i != bookmarks.end(); ++i) { 383 i != bookmarks.end(); ++i) {
384 NodeToMenuIDMap::iterator node_to_menu = node_to_menu_id_map_.find(*i); 384 NodeToMenuIDMap::iterator node_to_menu = node_to_menu_id_map_.find(*i);
385 if (node_to_menu != node_to_menu_id_map_.end()) { 385 if (node_to_menu != node_to_menu_id_map_.end()) {
386 MenuItemView* menu = GetMenuByID(node_to_menu->second); 386 MenuItemView* menu = GetMenuByID(node_to_menu->second);
387 DCHECK(menu); // If there an entry in node_to_menu_id_map_, there should 387 DCHECK(menu); // If there an entry in node_to_menu_id_map_, there should
388 // be a menu. 388 // be a menu.
389 removed_menus->insert(menu); 389 removed_menus->insert(menu);
390 changed_parent_menus.insert(menu->GetParentMenuItem()); 390 changed_parent_menus.insert(menu->GetParentMenuItem());
391 menu->GetParent()->RemoveChildView(menu); 391 menu->parent()->RemoveChildView(menu);
392 node_to_menu_id_map_.erase(node_to_menu); 392 node_to_menu_id_map_.erase(node_to_menu);
393 } 393 }
394 } 394 }
395 395
396 // All the bookmarks in |bookmarks| should have the same parent. It's possible 396 // All the bookmarks in |bookmarks| should have the same parent. It's possible
397 // to support different parents, but this would need to prune any nodes whose 397 // to support different parents, but this would need to prune any nodes whose
398 // parent has been removed. As all nodes currently have the same parent, there 398 // parent has been removed. As all nodes currently have the same parent, there
399 // is the DCHECK. 399 // is the DCHECK.
400 DCHECK(changed_parent_menus.size() <= 1); 400 DCHECK(changed_parent_menus.size() <= 1);
401 401
(...skipping 13 matching lines...) Expand all
415 break; 415 break;
416 } 416 }
417 } 417 }
418 if (ancestor_removed) { 418 if (ancestor_removed) {
419 node_to_menu_id_map_.erase(i++); 419 node_to_menu_id_map_.erase(i++);
420 } else { 420 } else {
421 ++i; 421 ++i;
422 } 422 }
423 } 423 }
424 } 424 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmark_editor_view_unittest.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