| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/history/starred_url_database.h" | 5 #include "chrome/browser/history/starred_url_database.h" |
| 6 | 6 |
| 7 #include "app/sql/connection.h" | 7 #include "app/sql/connection.h" |
| 8 #include "app/sql/statement.h" | 8 #include "app/sql/statement.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 12 #include "base/scoped_vector.h" | 12 #include "base/scoped_vector.h" |
| 13 #include "base/stl_util-inl.h" | 13 #include "base/stl_util-inl.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/bookmarks/bookmark_codec.h" | 16 #include "chrome/browser/bookmarks/bookmark_codec.h" |
| 17 #include "chrome/browser/bookmarks/bookmark_model.h" | 17 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 18 #include "chrome/browser/history/history.h" | 18 #include "chrome/browser/history/history.h" |
| 19 #include "chrome/browser/history/query_parser.h" | 19 #include "chrome/browser/history/query_parser.h" |
| 20 #include "chrome/browser/meta_table_helper.h" | 20 #include "chrome/browser/meta_table_helper.h" |
| 21 | 21 |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 // visual order so that we know we maintain visual order by always adding | 613 // visual order so that we know we maintain visual order by always adding |
| 614 // to the end. | 614 // to the end. |
| 615 parent->Add(parent->GetChildCount(), node); | 615 parent->Add(parent->GetChildCount(), node); |
| 616 } | 616 } |
| 617 | 617 |
| 618 // Save to file. | 618 // Save to file. |
| 619 BookmarkCodec encoder; | 619 BookmarkCodec encoder; |
| 620 scoped_ptr<Value> encoded_bookmarks( | 620 scoped_ptr<Value> encoded_bookmarks( |
| 621 encoder.Encode(&bookmark_bar_node, &other_node)); | 621 encoder.Encode(&bookmark_bar_node, &other_node)); |
| 622 std::string content; | 622 std::string content; |
| 623 JSONWriter::Write(encoded_bookmarks.get(), true, &content); | 623 base::JSONWriter::Write(encoded_bookmarks.get(), true, &content); |
| 624 | 624 |
| 625 return (file_util::WriteFile(path, content.c_str(), | 625 return (file_util::WriteFile(path, content.c_str(), |
| 626 static_cast<int>(content.length())) != -1); | 626 static_cast<int>(content.length())) != -1); |
| 627 } | 627 } |
| 628 | 628 |
| 629 } // namespace history | 629 } // namespace history |
| OLD | NEW |