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