| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/bookmark_context_menu_controller_views.h" | 5 #include "chrome/browser/views/bookmark_context_menu_controller_views.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_editor.h" | 8 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_folder_editor_controller.h" | 9 #include "chrome/browser/bookmarks/bookmark_folder_editor_controller.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/browser.h" | |
| 13 #include "chrome/browser/browser_list.h" | 12 #include "chrome/browser/browser_list.h" |
| 14 #include "chrome/browser/metrics/user_metrics.h" | 13 #include "chrome/browser/metrics/user_metrics.h" |
| 15 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
| 16 #include "chrome/browser/profile.h" | 15 #include "chrome/browser/profile.h" |
| 17 #include "chrome/browser/tab_contents/page_navigator.h" | 16 #include "chrome/browser/tab_contents/page_navigator.h" |
| 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // Returns true if the specified node is of type URL, or has a descendant | 23 // Returns true if the specified node is of type URL, or has a descendant |
| 24 // of type URL. | 24 // of type URL. |
| 25 bool NodeHasURLs(const BookmarkNode* node) { | 25 bool NodeHasURLs(const BookmarkNode* node) { |
| 26 if (node->is_url()) | 26 if (node->is_url()) |
| 27 return true; | 27 return true; |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 return model; | 283 return model; |
| 284 } | 284 } |
| 285 | 285 |
| 286 bool BookmarkContextMenuControllerViews::HasURLs() const { | 286 bool BookmarkContextMenuControllerViews::HasURLs() const { |
| 287 for (size_t i = 0; i < selection_.size(); ++i) { | 287 for (size_t i = 0; i < selection_.size(); ++i) { |
| 288 if (NodeHasURLs(selection_[i])) | 288 if (NodeHasURLs(selection_[i])) |
| 289 return true; | 289 return true; |
| 290 } | 290 } |
| 291 return false; | 291 return false; |
| 292 } | 292 } |
| OLD | NEW |