| 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 "components/omnibox/browser/shortcuts_database.h" | 5 #include "components/omnibox/browser/shortcuts_database.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 destination_url(destination_url), | 73 destination_url(destination_url), |
| 74 contents(contents), | 74 contents(contents), |
| 75 contents_class(contents_class), | 75 contents_class(contents_class), |
| 76 description(description), | 76 description(description), |
| 77 description_class(description_class), | 77 description_class(description_class), |
| 78 transition(transition), | 78 transition(transition), |
| 79 type(type), | 79 type(type), |
| 80 keyword(keyword) { | 80 keyword(keyword) { |
| 81 } | 81 } |
| 82 | 82 |
| 83 ShortcutsDatabase::Shortcut::MatchCore::MatchCore(const MatchCore& other) = |
| 84 default; |
| 85 |
| 83 ShortcutsDatabase::Shortcut::MatchCore::~MatchCore() { | 86 ShortcutsDatabase::Shortcut::MatchCore::~MatchCore() { |
| 84 } | 87 } |
| 85 | 88 |
| 86 // ShortcutsDatabase::Shortcut ------------------------------------------------ | 89 // ShortcutsDatabase::Shortcut ------------------------------------------------ |
| 87 | 90 |
| 88 ShortcutsDatabase::Shortcut::Shortcut( | 91 ShortcutsDatabase::Shortcut::Shortcut( |
| 89 const std::string& id, | 92 const std::string& id, |
| 90 const base::string16& text, | 93 const base::string16& text, |
| 91 const MatchCore& match_core, | 94 const MatchCore& match_core, |
| 92 const base::Time& last_access_time, | 95 const base::Time& last_access_time, |
| 93 int number_of_hits) | 96 int number_of_hits) |
| 94 : id(id), | 97 : id(id), |
| 95 text(text), | 98 text(text), |
| 96 match_core(match_core), | 99 match_core(match_core), |
| 97 last_access_time(last_access_time), | 100 last_access_time(last_access_time), |
| 98 number_of_hits(number_of_hits) { | 101 number_of_hits(number_of_hits) { |
| 99 } | 102 } |
| 100 | 103 |
| 101 ShortcutsDatabase::Shortcut::Shortcut() | 104 ShortcutsDatabase::Shortcut::Shortcut() |
| 102 : match_core(base::string16(), GURL(), base::string16(), std::string(), | 105 : match_core(base::string16(), GURL(), base::string16(), std::string(), |
| 103 base::string16(), std::string(), 0, 0, base::string16()), | 106 base::string16(), std::string(), 0, 0, base::string16()), |
| 104 last_access_time(base::Time::Now()), | 107 last_access_time(base::Time::Now()), |
| 105 number_of_hits(0) { | 108 number_of_hits(0) { |
| 106 } | 109 } |
| 107 | 110 |
| 111 ShortcutsDatabase::Shortcut::Shortcut(const Shortcut& other) = default; |
| 112 |
| 108 ShortcutsDatabase::Shortcut::~Shortcut() { | 113 ShortcutsDatabase::Shortcut::~Shortcut() { |
| 109 } | 114 } |
| 110 | 115 |
| 111 | 116 |
| 112 // ShortcutsDatabase ---------------------------------------------------------- | 117 // ShortcutsDatabase ---------------------------------------------------------- |
| 113 | 118 |
| 114 ShortcutsDatabase::ShortcutsDatabase(const base::FilePath& database_path) | 119 ShortcutsDatabase::ShortcutsDatabase(const base::FilePath& database_path) |
| 115 : database_path_(database_path) { | 120 : database_path_(database_path) { |
| 116 } | 121 } |
| 117 | 122 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 "SET type = 15 WHERE type = 11").c_str()) && | 271 "SET type = 15 WHERE type = 11").c_str()) && |
| 267 // Migrate old BOOKMARK_TITLE values to the new type value. | 272 // Migrate old BOOKMARK_TITLE values to the new type value. |
| 268 db_.Execute(base::StringPrintf("UPDATE omni_box_shortcuts " | 273 db_.Execute(base::StringPrintf("UPDATE omni_box_shortcuts " |
| 269 "SET type = 16 WHERE type = 12").c_str()) && | 274 "SET type = 16 WHERE type = 12").c_str()) && |
| 270 transaction.Commit())) { | 275 transaction.Commit())) { |
| 271 return false; | 276 return false; |
| 272 } | 277 } |
| 273 } | 278 } |
| 274 return true; | 279 return true; |
| 275 } | 280 } |
| OLD | NEW |