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

Side by Side Diff: chrome/browser/ui/bookmarks/bookmark_utils.cc

Issue 870293002: bookmarks: BookmarkNodeData's size() cleanups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix the implementation of has_single_url() Created 5 years, 11 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
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/bookmarks/bookmark_utils.h" 5 #include "chrome/browser/ui/bookmarks/bookmark_utils.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 return ui::DragDropTypes::DRAG_NONE; 407 return ui::DragDropTypes::DRAG_NONE;
408 } 408 }
409 409
410 int GetBookmarkDropOperation(Profile* profile, 410 int GetBookmarkDropOperation(Profile* profile,
411 const ui::DropTargetEvent& event, 411 const ui::DropTargetEvent& event,
412 const bookmarks::BookmarkNodeData& data, 412 const bookmarks::BookmarkNodeData& data,
413 const BookmarkNode* parent, 413 const BookmarkNode* parent,
414 int index) { 414 int index) {
415 const base::FilePath& profile_path = profile->GetPath(); 415 const base::FilePath& profile_path = profile->GetPath();
416 416
417 if (data.IsFromProfilePath(profile_path) && data.size() > 1) 417 if (data.IsFromProfilePath(profile_path) && data.num_elements() > 1)
418 // Currently only accept one dragged node at a time. 418 // Currently only accept one dragged node at a time.
419 return ui::DragDropTypes::DRAG_NONE; 419 return ui::DragDropTypes::DRAG_NONE;
420 420
421 if (!IsValidBookmarkDropLocation(profile, data, parent, index)) 421 if (!IsValidBookmarkDropLocation(profile, data, parent, index))
422 return ui::DragDropTypes::DRAG_NONE; 422 return ui::DragDropTypes::DRAG_NONE;
423 423
424 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); 424 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile);
425 if (!model->client()->CanBeEditedByUser(parent)) 425 if (!model->client()->CanBeEditedByUser(parent))
426 return ui::DragDropTypes::DRAG_NONE; 426 return ui::DragDropTypes::DRAG_NONE;
427 427
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 if (drop_parent->HasAncestor(node)) 474 if (drop_parent->HasAncestor(node))
475 return false; 475 return false;
476 } 476 }
477 return true; 477 return true;
478 } 478 }
479 // From another profile, always accept. 479 // From another profile, always accept.
480 return true; 480 return true;
481 } 481 }
482 482
483 } // namespace chrome 483 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698