OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // User of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_EXTENSIONS_BLOCKED_ACTIONS_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_BLOCKED_ACTIONS_H_ | |
7 | |
8 #include <string> | |
9 #include "base/time.h" | |
10 #include "chrome/browser/extensions/activity_actions.h" | |
11 | |
12 namespace extensions { | |
13 | |
14 extern const char* blocked_table_name_; | |
Eric Dingle
2012/12/13 20:37:34
These should be declared as private static char ar
felt
2012/12/15 02:51:52
These are used in ActivityDatabase::InitializeTabl
Eric Dingle
2012/12/18 21:55:35
Couldn't you define this as a member variable of t
felt
2012/12/18 23:28:54
The code that uses the db name doesn't actually ha
Eric Dingle
2012/12/19 16:04:11
You should declare it as:
static const char* kTab
felt
2012/12/19 17:56:27
Ohhh. I understand now. Done.
| |
15 extern const char* blocked_table_structure_; | |
16 | |
17 class BlockedAction : public Action, | |
18 public base::RefCountedThreadSafe<BlockedAction> { | |
19 public: | |
20 BlockedAction(const std::string& extension_id, | |
21 const std::string& blocked_action, | |
22 const std::string& reason, | |
23 const base::Time& time); | |
24 | |
25 // Print a UrlAction with il8n substitutions for display. | |
Eric Dingle
2012/12/13 20:37:34
*BlockedAction
felt
2012/12/15 02:51:52
sorry -- what does this mean?
Eric Dingle
2012/12/18 21:55:35
You have a copy and paste error.
felt
2012/12/18 23:28:54
Done.
| |
26 virtual std::string PrettyPrintFori18n() OVERRIDE; | |
27 | |
28 // Print a UrlAction as a regular string for debugging purposes. | |
Eric Dingle
2012/12/13 20:37:34
*BlockedAction
felt
2012/12/18 23:28:54
Done.
| |
29 virtual std::string PrettyPrintForDebug() OVERRIDE; | |
30 | |
31 // Helper methods for recording the values into the db. | |
32 const std::string& extension_id() const { return extension_id_; } | |
33 const base::Time& time() const { return time_; } | |
34 const std::string& reason() const { return reason_; } | |
35 const std::string& blocked_action() const { return blocked_action_; } | |
36 | |
37 protected: | |
38 virtual ~BlockedAction(); | |
Eric Dingle
2012/12/13 20:37:34
No need for this to be protected. Declare it benea
felt
2012/12/15 02:51:52
It needs to be protected because of how scoped_ref
| |
39 | |
40 private: | |
41 friend class base::RefCountedThreadSafe<BlockedAction>; | |
42 | |
43 std::string extension_id_; | |
44 std::string blocked_action_; | |
45 std::string reason_; | |
46 base::Time time_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(BlockedAction); | |
49 }; | |
50 | |
51 } // namespace | |
52 | |
53 #endif // CHROME_BROWSER_EXTENSIONS_BLOCKED_ACTIONS_H_ | |
54 | |
OLD | NEW |