OLD | NEW |
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/bookmarks/bookmark_utils.h" | 5 #include "chrome/browser/bookmarks/bookmark_utils.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/i18n/case_conversion.h" | 11 #include "base/i18n/case_conversion.h" |
12 #include "base/i18n/string_search.h" | 12 #include "base/i18n/string_search.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/string16.h" | 14 #include "base/string16.h" |
15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
16 #include "base/time.h" | 16 #include "base/time.h" |
17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
18 #include "chrome/browser/bookmarks/bookmark_model.h" | 18 #include "chrome/browser/bookmarks/bookmark_model.h" |
19 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 19 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
20 #include "chrome/browser/history/query_parser.h" | 20 #include "chrome/browser/history/query_parser.h" |
21 #include "chrome/browser/prefs/pref_service.h" | 21 #include "chrome/browser/prefs/pref_service.h" |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/simple_message_box.h" | 23 #include "chrome/browser/simple_message_box.h" |
24 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
25 #include "chrome/browser/ui/browser_list.h" | 25 #include "chrome/browser/ui/browser_list.h" |
26 #include "chrome/browser/ui/browser_window.h" | 26 #include "chrome/browser/ui/browser_window.h" |
27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
28 #include "content/browser/tab_contents/tab_contents.h" | |
29 #include "content/public/browser/page_navigator.h" | 28 #include "content/public/browser/page_navigator.h" |
| 29 #include "content/public/browser/web_contents.h" |
30 #include "grit/chromium_strings.h" | 30 #include "grit/chromium_strings.h" |
31 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
32 #include "grit/ui_strings.h" | 32 #include "grit/ui_strings.h" |
33 #include "net/base/net_util.h" | 33 #include "net/base/net_util.h" |
34 #include "ui/base/dragdrop/drag_drop_types.h" | 34 #include "ui/base/dragdrop/drag_drop_types.h" |
35 #include "ui/base/l10n/l10n_util.h" | 35 #include "ui/base/l10n/l10n_util.h" |
36 #include "ui/base/models/tree_node_iterator.h" | 36 #include "ui/base/models/tree_node_iterator.h" |
37 | 37 |
38 #if defined(OS_MACOSX) | 38 #if defined(OS_MACOSX) |
39 #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h" | 39 #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h" |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 : NULL; | 667 : NULL; |
668 if (web_contents) | 668 if (web_contents) |
669 GetURLAndTitleToBookmark(web_contents, url, title); | 669 GetURLAndTitleToBookmark(web_contents, url, title); |
670 } | 670 } |
671 | 671 |
672 void GetURLsForOpenTabs( | 672 void GetURLsForOpenTabs( |
673 Browser* browser, | 673 Browser* browser, |
674 std::vector<std::pair<GURL, string16> >* urls) { | 674 std::vector<std::pair<GURL, string16> >* urls) { |
675 for (int i = 0; i < browser->tab_count(); ++i) { | 675 for (int i = 0; i < browser->tab_count(); ++i) { |
676 std::pair<GURL, string16> entry; | 676 std::pair<GURL, string16> entry; |
677 GetURLAndTitleToBookmark(browser->GetTabContentsAt(i), &(entry.first), | 677 GetURLAndTitleToBookmark(browser->GetWebContentsAt(i), &(entry.first), |
678 &(entry.second)); | 678 &(entry.second)); |
679 urls->push_back(entry); | 679 urls->push_back(entry); |
680 } | 680 } |
681 } | 681 } |
682 | 682 |
683 const BookmarkNode* GetParentForNewNodes( | 683 const BookmarkNode* GetParentForNewNodes( |
684 const BookmarkNode* parent, | 684 const BookmarkNode* parent, |
685 const std::vector<const BookmarkNode*>& selection, | 685 const std::vector<const BookmarkNode*>& selection, |
686 int* index) { | 686 int* index) { |
687 const BookmarkNode* real_parent = parent; | 687 const BookmarkNode* real_parent = parent; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 void RecordBookmarkLaunch(BookmarkLaunchLocation location) { | 770 void RecordBookmarkLaunch(BookmarkLaunchLocation location) { |
771 #if defined(OS_WIN) | 771 #if defined(OS_WIN) |
772 // TODO(estade): do this on other platforms too. For now it's compiled out | 772 // TODO(estade): do this on other platforms too. For now it's compiled out |
773 // so that stats from platforms for which this is incompletely implemented | 773 // so that stats from platforms for which this is incompletely implemented |
774 // don't mix in with Windows, where it should be implemented exhaustively. | 774 // don't mix in with Windows, where it should be implemented exhaustively. |
775 UMA_HISTOGRAM_ENUMERATION("Bookmarks.LaunchLocation", location, LAUNCH_LIMIT); | 775 UMA_HISTOGRAM_ENUMERATION("Bookmarks.LaunchLocation", location, LAUNCH_LIMIT); |
776 #endif | 776 #endif |
777 } | 777 } |
778 | 778 |
779 } // namespace bookmark_utils | 779 } // namespace bookmark_utils |
OLD | NEW |