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 "chrome/browser/bookmarks/bookmark_extension_api.h" | 5 #include "chrome/browser/bookmarks/bookmark_extension_api.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/i18n/file_util_icu.h" | 9 #include "base/i18n/file_util_icu.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 }; | 698 }; |
699 | 699 |
700 // Mapper for 'bookmarks.create'. Maps "same input to bookmarks.create" to a | 700 // Mapper for 'bookmarks.create'. Maps "same input to bookmarks.create" to a |
701 // unique bucket. | 701 // unique bucket. |
702 class CreateBookmarkBucketMapper : public BookmarkBucketMapper<std::string> { | 702 class CreateBookmarkBucketMapper : public BookmarkBucketMapper<std::string> { |
703 public: | 703 public: |
704 explicit CreateBookmarkBucketMapper(Profile* profile) : profile_(profile) {} | 704 explicit CreateBookmarkBucketMapper(Profile* profile) : profile_(profile) {} |
705 // TODO(tim): This should share code with CreateBookmarkFunction::RunImpl, | 705 // TODO(tim): This should share code with CreateBookmarkFunction::RunImpl, |
706 // but I can't figure out a good way to do that with all the macros. | 706 // but I can't figure out a good way to do that with all the macros. |
707 virtual void GetBucketsForArgs(const ListValue* args, BucketList* buckets) { | 707 virtual void GetBucketsForArgs(const ListValue* args, BucketList* buckets) { |
708 DictionaryValue* json; | 708 const DictionaryValue* json; |
709 if (!args->GetDictionary(0, &json)) | 709 if (!args->GetDictionary(0, &json)) |
710 return; | 710 return; |
711 | 711 |
712 std::string parent_id; | 712 std::string parent_id; |
713 if (json->HasKey(keys::kParentIdKey)) { | 713 if (json->HasKey(keys::kParentIdKey)) { |
714 if (!json->GetString(keys::kParentIdKey, &parent_id)) | 714 if (!json->GetString(keys::kParentIdKey, &parent_id)) |
715 return; | 715 return; |
716 } | 716 } |
717 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile_); | 717 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile_); |
718 | 718 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 int index, | 960 int index, |
961 void* params) { | 961 void* params) { |
962 #if !defined(OS_ANDROID) | 962 #if !defined(OS_ANDROID) |
963 // Android does not have support for the standard exporter. | 963 // Android does not have support for the standard exporter. |
964 // TODO(jgreenwald): remove ifdef once extensions are no longer built on | 964 // TODO(jgreenwald): remove ifdef once extensions are no longer built on |
965 // Android. | 965 // Android. |
966 bookmark_html_writer::WriteBookmarks(profile(), path, NULL); | 966 bookmark_html_writer::WriteBookmarks(profile(), path, NULL); |
967 #endif | 967 #endif |
968 Release(); // Balanced in BookmarksIOFunction::SelectFile() | 968 Release(); // Balanced in BookmarksIOFunction::SelectFile() |
969 } | 969 } |
OLD | NEW |