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 // This class describes API calls that ran into permissions or quots problems. |
| 15 // See ManagerActions for API calls that succeeded. |
| 16 class BlockedAction : public Action, |
| 17 public base::RefCountedThreadSafe<BlockedAction> { |
| 18 public: |
| 19 static const char* kTableName; |
| 20 static const char* kTableStructure; |
| 21 |
| 22 BlockedAction(const std::string& extension_id, |
| 23 const std::string& blocked_action, |
| 24 const std::string& reason, |
| 25 const base::Time& time); |
| 26 |
| 27 // Print a BlockedAction with il8n substitutions for display. |
| 28 virtual std::string PrettyPrintFori18n() OVERRIDE; |
| 29 |
| 30 // Print a BlockedAction as a regular string for debugging purposes. |
| 31 virtual std::string PrettyPrintForDebug() OVERRIDE; |
| 32 |
| 33 // Helper methods for recording the values into the db. |
| 34 const std::string& extension_id() const { return extension_id_; } |
| 35 const base::Time& time() const { return time_; } |
| 36 const std::string& reason() const { return reason_; } |
| 37 const std::string& blocked_action() const { return blocked_action_; } |
| 38 |
| 39 protected: |
| 40 virtual ~BlockedAction(); |
| 41 |
| 42 private: |
| 43 friend class base::RefCountedThreadSafe<BlockedAction>; |
| 44 |
| 45 std::string extension_id_; |
| 46 std::string blocked_action_; |
| 47 std::string reason_; |
| 48 base::Time time_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(BlockedAction); |
| 51 }; |
| 52 |
| 53 } // namespace extensions |
| 54 |
| 55 #endif // CHROME_BROWSER_EXTENSIONS_BLOCKED_ACTIONS_H_ |
| 56 |
OLD | NEW |