| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/bookmarks/bookmarks_utils.h" | 5 #include "ios/chrome/browser/bookmarks/bookmarks_utils.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "components/bookmarks/browser/bookmark_model.h" | 9 #include "components/bookmarks/browser/bookmark_model.h" |
| 10 #include "components/prefs/pref_service.h" | 10 #include "components/prefs/pref_service.h" |
| 11 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" | 11 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" |
| 12 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 12 #include "ios/chrome/browser/pref_names.h" | 13 #include "ios/chrome/browser/pref_names.h" |
| 13 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" | |
| 14 | 14 |
| 15 using bookmarks::BookmarkModel; | 15 using bookmarks::BookmarkModel; |
| 16 using bookmarks::BookmarkNode; | 16 using bookmarks::BookmarkNode; |
| 17 | 17 |
| 18 void RecordBookmarkLaunch(BookmarkLaunchLocation launch_location) { | 18 void RecordBookmarkLaunch(BookmarkLaunchLocation launch_location) { |
| 19 DCHECK(launch_location < BOOKMARK_LAUNCH_LOCATION_COUNT); | 19 DCHECK(launch_location < BOOKMARK_LAUNCH_LOCATION_COUNT); |
| 20 UMA_HISTOGRAM_ENUMERATION("Stars.LaunchLocation", launch_location, | 20 UMA_HISTOGRAM_ENUMERATION("Stars.LaunchLocation", launch_location, |
| 21 BOOKMARK_LAUNCH_LOCATION_COUNT); | 21 BOOKMARK_LAUNCH_LOCATION_COUNT); |
| 22 } | 22 } |
| 23 | 23 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 const std::vector<const BookmarkNode*> root_folders(RootLevelFolders(model)); | 89 const std::vector<const BookmarkNode*> root_folders(RootLevelFolders(model)); |
| 90 const BookmarkNode* top = node; | 90 const BookmarkNode* top = node; |
| 91 while (top && | 91 while (top && |
| 92 std::find(root_folders.begin(), root_folders.end(), top) == | 92 std::find(root_folders.begin(), root_folders.end(), top) == |
| 93 root_folders.end()) { | 93 root_folders.end()) { |
| 94 top = top->parent(); | 94 top = top->parent(); |
| 95 } | 95 } |
| 96 return top; | 96 return top; |
| 97 } | 97 } |
| OLD | NEW |