Index: chrome/browser/extensions/blocked_actions.h |
=================================================================== |
--- chrome/browser/extensions/blocked_actions.h (revision 0) |
+++ chrome/browser/extensions/blocked_actions.h (revision 0) |
@@ -0,0 +1,54 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// User of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_EXTENSIONS_BLOCKED_ACTIONS_H_ |
+#define CHROME_BROWSER_EXTENSIONS_BLOCKED_ACTIONS_H_ |
+ |
+#include <string> |
+#include "base/time.h" |
+#include "chrome/browser/extensions/activity_actions.h" |
+ |
+namespace extensions { |
+ |
+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.
|
+extern const char* blocked_table_structure_; |
+ |
+class BlockedAction : public Action, |
+ public base::RefCountedThreadSafe<BlockedAction> { |
+ public: |
+ BlockedAction(const std::string& extension_id, |
+ const std::string& blocked_action, |
+ const std::string& reason, |
+ const base::Time& time); |
+ |
+ // 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.
|
+ virtual std::string PrettyPrintFori18n() OVERRIDE; |
+ |
+ // 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.
|
+ virtual std::string PrettyPrintForDebug() OVERRIDE; |
+ |
+ // Helper methods for recording the values into the db. |
+ const std::string& extension_id() const { return extension_id_; } |
+ const base::Time& time() const { return time_; } |
+ const std::string& reason() const { return reason_; } |
+ const std::string& blocked_action() const { return blocked_action_; } |
+ |
+ protected: |
+ 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
|
+ |
+ private: |
+ friend class base::RefCountedThreadSafe<BlockedAction>; |
+ |
+ std::string extension_id_; |
+ std::string blocked_action_; |
+ std::string reason_; |
+ base::Time time_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BlockedAction); |
+}; |
+ |
+} // namespace |
+ |
+#endif // CHROME_BROWSER_EXTENSIONS_BLOCKED_ACTIONS_H_ |
+ |