| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 virtual std::string PrintForDebug() = 0; | 31 virtual std::string PrintForDebug() = 0; |
| 32 | 32 |
| 33 const std::string& extension_id() const { return extension_id_; } | 33 const std::string& extension_id() const { return extension_id_; } |
| 34 const base::Time& time() const { return time_; } | 34 const base::Time& time() const { return time_; } |
| 35 | 35 |
| 36 protected: | 36 protected: |
| 37 Action(const std::string& extension_id, const base::Time& time); | 37 Action(const std::string& extension_id, const base::Time& time); |
| 38 virtual ~Action() {} | 38 virtual ~Action() {} |
| 39 | 39 |
| 40 // Initialize the table for a given action type. | 40 // Initialize the table for a given action type. |
| 41 // The content_fields array should list the names of all of the columns in |
| 42 // the database. The field_types should specify the types of the corresponding |
| 43 // columns (e.g., INTEGER or LONGVARCHAR). There should be the same number of |
| 44 // field_types as content_fields, since the two arrays should correspond. |
| 41 static bool InitializeTableInternal(sql::Connection* db, | 45 static bool InitializeTableInternal(sql::Connection* db, |
| 42 const char* table_name, | 46 const char* table_name, |
| 43 const char* content_fields[], | 47 const char* content_fields[], |
| 48 const char* field_types[], |
| 44 const int num_content_fields); | 49 const int num_content_fields); |
| 45 | 50 |
| 46 private: | 51 private: |
| 47 friend class base::RefCountedThreadSafe<Action>; | 52 friend class base::RefCountedThreadSafe<Action>; |
| 48 | 53 |
| 49 std::string extension_id_; | 54 std::string extension_id_; |
| 50 base::Time time_; | 55 base::Time time_; |
| 51 | 56 |
| 52 DISALLOW_COPY_AND_ASSIGN(Action); | 57 DISALLOW_COPY_AND_ASSIGN(Action); |
| 53 }; | 58 }; |
| 54 | 59 |
| 55 } // namespace extensions | 60 } // namespace extensions |
| 56 | 61 |
| 57 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ | 62 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_ACTIONS_H_ |
| 58 | 63 |
| OLD | NEW |