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 #ifndef CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ | 5 #ifndef CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ |
6 #define CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ | 6 #define CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
| 11 #include "base/compiler_specific.h" |
11 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
12 #include "base/string16.h" | 13 #include "base/string16.h" |
13 #include "chrome/browser/webdata/web_database_table.h" | 14 #include "chrome/browser/webdata/web_database_table.h" |
14 #include "chrome/browser/search_engines/template_url_id.h" | 15 #include "chrome/browser/search_engines/template_url_id.h" |
15 | 16 |
16 class TemplateURL; | 17 class TemplateURL; |
17 | 18 |
18 // This class manages the |keywords| MetaTable within the SQLite database | 19 // This class manages the |keywords| MetaTable within the SQLite database |
19 // passed to the constructor. It expects the following schema: | 20 // passed to the constructor. It expects the following schema: |
20 // | 21 // |
(...skipping 26 matching lines...) Expand all Loading... |
47 // last_modified See TemplateURL::last_modified. This was added in | 48 // last_modified See TemplateURL::last_modified. This was added in |
48 // version 38. | 49 // version 38. |
49 // sync_guid See TemplateURL::sync_guid. This was added in | 50 // sync_guid See TemplateURL::sync_guid. This was added in |
50 // version 39. | 51 // version 39. |
51 // | 52 // |
52 class KeywordTable : public WebDatabaseTable { | 53 class KeywordTable : public WebDatabaseTable { |
53 public: | 54 public: |
54 KeywordTable(sql::Connection* db, sql::MetaTable* meta_table) | 55 KeywordTable(sql::Connection* db, sql::MetaTable* meta_table) |
55 : WebDatabaseTable(db, meta_table) {} | 56 : WebDatabaseTable(db, meta_table) {} |
56 virtual ~KeywordTable(); | 57 virtual ~KeywordTable(); |
57 virtual bool Init(); | 58 virtual bool Init() OVERRIDE; |
58 virtual bool IsSyncable(); | 59 virtual bool IsSyncable() OVERRIDE; |
59 | 60 |
60 // Adds a new keyword, updating the id field on success. | 61 // Adds a new keyword, updating the id field on success. |
61 // Returns true if successful. | 62 // Returns true if successful. |
62 bool AddKeyword(const TemplateURL& url); | 63 bool AddKeyword(const TemplateURL& url); |
63 | 64 |
64 // Removes the specified keyword. | 65 // Removes the specified keyword. |
65 // Returns true if successful. | 66 // Returns true if successful. |
66 bool RemoveKeyword(TemplateURLID id); | 67 bool RemoveKeyword(TemplateURLID id); |
67 | 68 |
68 // Loads the keywords into the specified vector. It's up to the caller to | 69 // Loads the keywords into the specified vector. It's up to the caller to |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // occurred (i.e. by third-party process trying to modify user settings). | 110 // occurred (i.e. by third-party process trying to modify user settings). |
110 bool SetDefaultSearchProviderBackupID(int64 id); | 111 bool SetDefaultSearchProviderBackupID(int64 id); |
111 | 112 |
112 // Sets signature for the backup field. | 113 // Sets signature for the backup field. |
113 bool SetDefaultSearchProviderBackupIDSignature(int64 id); | 114 bool SetDefaultSearchProviderBackupIDSignature(int64 id); |
114 | 115 |
115 DISALLOW_COPY_AND_ASSIGN(KeywordTable); | 116 DISALLOW_COPY_AND_ASSIGN(KeywordTable); |
116 }; | 117 }; |
117 | 118 |
118 #endif // CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ | 119 #endif // CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ |
OLD | NEW |