Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Side by Side Diff: chrome/browser/history/starred_url_database.cc

Issue 1700017: Get rid of MetaTableHelper class and make use of the app/sql API in the LoginDatabase. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: fix rebase that removed the chrome_tests.gypi Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « app/sql/statement.cc ('k') | chrome/browser/history/thumbnail_database.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/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"
21 20
22 // The following table is used to store star (aka bookmark) information. This 21 // The following table is used to store star (aka bookmark) information. This
23 // class derives from URLDatabase, which has its own schema. 22 // class derives from URLDatabase, which has its own schema.
24 // 23 //
25 // starred 24 // starred
26 // id Unique identifier (primary key) for the entry. 25 // id Unique identifier (primary key) for the entry.
27 // type Type of entry, if 0 this corresponds to a URL, 1 for 26 // type Type of entry, if 0 this corresponds to a URL, 1 for
28 // a system grouping, 2 for a user created group, 3 for 27 // a system grouping, 2 for a user created group, 3 for
29 // other. 28 // other.
30 // url_id ID of the url, only valid if type == 0 29 // url_id ID of the url, only valid if type == 0
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 scoped_ptr<Value> encoded_bookmarks( 619 scoped_ptr<Value> encoded_bookmarks(
621 encoder.Encode(&bookmark_bar_node, &other_node)); 620 encoder.Encode(&bookmark_bar_node, &other_node));
622 std::string content; 621 std::string content;
623 base::JSONWriter::Write(encoded_bookmarks.get(), true, &content); 622 base::JSONWriter::Write(encoded_bookmarks.get(), true, &content);
624 623
625 return (file_util::WriteFile(path, content.c_str(), 624 return (file_util::WriteFile(path, content.c_str(),
626 static_cast<int>(content.length())) != -1); 625 static_cast<int>(content.length())) != -1);
627 } 626 }
628 627
629 } // namespace history 628 } // namespace history
OLDNEW
« no previous file with comments | « app/sql/statement.cc ('k') | chrome/browser/history/thumbnail_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698