OLD | NEW |
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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h" | 7 #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 #if defined(OS_POSIX) | 78 #if defined(OS_POSIX) |
79 base::FilePath::StringType filename = | 79 base::FilePath::StringType filename = |
80 l10n_util::GetStringFUTF8(IDS_EXPORT_BOOKMARKS_DEFAULT_FILENAME, | 80 l10n_util::GetStringFUTF8(IDS_EXPORT_BOOKMARKS_DEFAULT_FILENAME, |
81 base::TimeFormatShortDateNumeric(time)); | 81 base::TimeFormatShortDateNumeric(time)); |
82 #elif defined(OS_WIN) | 82 #elif defined(OS_WIN) |
83 base::FilePath::StringType filename = | 83 base::FilePath::StringType filename = |
84 l10n_util::GetStringFUTF16(IDS_EXPORT_BOOKMARKS_DEFAULT_FILENAME, | 84 l10n_util::GetStringFUTF16(IDS_EXPORT_BOOKMARKS_DEFAULT_FILENAME, |
85 base::TimeFormatShortDateNumeric(time)); | 85 base::TimeFormatShortDateNumeric(time)); |
86 #endif | 86 #endif |
87 | 87 |
88 file_util::ReplaceIllegalCharactersInPath(&filename, '_'); | 88 base::i18n::ReplaceIllegalCharactersInPath(&filename, '_'); |
89 | 89 |
90 base::FilePath default_path; | 90 base::FilePath default_path; |
91 PathService::Get(chrome::DIR_USER_DOCUMENTS, &default_path); | 91 PathService::Get(chrome::DIR_USER_DOCUMENTS, &default_path); |
92 return default_path.Append(filename); | 92 return default_path.Append(filename); |
93 } | 93 } |
94 | 94 |
95 bool IsEnhancedBookmarksExtensionActive(Profile* profile) { | 95 bool IsEnhancedBookmarksExtensionActive(Profile* profile) { |
96 static const char *enhanced_extension_hashes[] = { | 96 static const char *enhanced_extension_hashes[] = { |
97 "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 | 97 "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 |
98 "D57DE394F36DC1C3220E7604C575D29C51A6C495", // http://crbug.com/319444 | 98 "D57DE394F36DC1C3220E7604C575D29C51A6C495", // http://crbug.com/319444 |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 void BookmarksExportFunction::FileSelected(const base::FilePath& path, | 908 void BookmarksExportFunction::FileSelected(const base::FilePath& path, |
909 int index, | 909 int index, |
910 void* params) { | 910 void* params) { |
911 // TODO(jgreenwald): remove ifdef once extensions are no longer built on | 911 // TODO(jgreenwald): remove ifdef once extensions are no longer built on |
912 // Android. | 912 // Android. |
913 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); | 913 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); |
914 Release(); // Balanced in BookmarksIOFunction::SelectFile() | 914 Release(); // Balanced in BookmarksIOFunction::SelectFile() |
915 } | 915 } |
916 | 916 |
917 } // namespace extensions | 917 } // namespace extensions |
OLD | NEW |