OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webdata/web_apps_table.h" | 5 #include "chrome/browser/webdata/web_apps_table.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/history/history_database.h" | 8 #include "chrome/browser/history/history_database.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 #include "sql/statement.h" | 10 #include "sql/statement.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
12 #include "ui/gfx/codec/png_codec.h" | 12 #include "ui/gfx/codec/png_codec.h" |
13 | 13 |
14 bool WebAppsTable::Init() { | 14 bool WebAppsTable::Init() { |
15 return (InitWebAppIconsTable() && InitWebAppsTable()); | 15 return (InitWebAppIconsTable() && InitWebAppsTable()); |
16 } | 16 } |
17 | 17 |
18 bool WebAppsTable::IsSyncable() { | 18 bool WebAppsTable::IsSyncable() { |
19 return true; | 19 return true; |
20 } | 20 } |
21 | 21 |
| 22 bool WebAppsTable::MigrateToVersion(int version, |
| 23 const std::string& app_locale, |
| 24 bool* update_compatible_version) { |
| 25 return true; |
| 26 } |
| 27 |
22 bool WebAppsTable::InitWebAppIconsTable() { | 28 bool WebAppsTable::InitWebAppIconsTable() { |
23 if (!db_->DoesTableExist("web_app_icons")) { | 29 if (!db_->DoesTableExist("web_app_icons")) { |
24 if (!db_->Execute("CREATE TABLE web_app_icons (" | 30 if (!db_->Execute("CREATE TABLE web_app_icons (" |
25 "url LONGVARCHAR," | 31 "url LONGVARCHAR," |
26 "width int," | 32 "width int," |
27 "height int," | 33 "height int," |
28 "image BLOB, UNIQUE (url, width, height))")) { | 34 "image BLOB, UNIQUE (url, width, height))")) { |
29 NOTREACHED(); | 35 NOTREACHED(); |
30 return false; | 36 return false; |
31 } | 37 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 119 |
114 if (!delete_s.Run()) | 120 if (!delete_s.Run()) |
115 return false; | 121 return false; |
116 | 122 |
117 sql::Statement delete_s2(db_->GetUniqueStatement( | 123 sql::Statement delete_s2(db_->GetUniqueStatement( |
118 "DELETE FROM web_apps WHERE url = ?")); | 124 "DELETE FROM web_apps WHERE url = ?")); |
119 delete_s2.BindString(0, history::HistoryDatabase::GURLToDatabaseURL(url)); | 125 delete_s2.BindString(0, history::HistoryDatabase::GURLToDatabaseURL(url)); |
120 | 126 |
121 return delete_s2.Run(); | 127 return delete_s2.Run(); |
122 } | 128 } |
OLD | NEW |