| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_USER_SCRIPT_MASTER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/shared_memory.h" | 12 #include "base/shared_memory.h" |
| 13 #include "chrome/browser/chrome_thread.h" | 13 #include "chrome/browser/chrome_thread.h" |
| 14 #include "chrome/common/extensions/user_script.h" | 14 #include "chrome/common/extensions/user_script.h" |
| 15 #include "chrome/common/notification_registrar.h" | 15 #include "chrome/common/notification_registrar.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class StringPiece; | 18 class StringPiece; |
| 19 } | 19 } |
| 20 | 20 |
| 21 class Extension; | |
| 22 class Profile; | 21 class Profile; |
| 23 | 22 |
| 24 // Manages a segment of shared memory that contains the user scripts the user | 23 // Manages a segment of shared memory that contains the user scripts the user |
| 25 // has installed. Lives on the UI thread. | 24 // has installed. Lives on the UI thread. |
| 26 class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>, | 25 class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>, |
| 27 public NotificationObserver { | 26 public NotificationObserver { |
| 28 public: | 27 public: |
| 29 // For testability, the constructor takes the path the scripts live in. | 28 // For testability, the constructor takes the path the scripts live in. |
| 30 // This is normally a directory inside the profile. | 29 // This is normally a directory inside the profile. |
| 31 explicit UserScriptMaster(const FilePath& script_dir, Profile* profile); | 30 explicit UserScriptMaster(const FilePath& script_dir, Profile* profile); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // finishes. This boolean tracks whether another scan is pending. | 152 // finishes. This boolean tracks whether another scan is pending. |
| 154 bool pending_scan_; | 153 bool pending_scan_; |
| 155 | 154 |
| 156 // The profile for which the scripts managed here are installed. | 155 // The profile for which the scripts managed here are installed. |
| 157 Profile* profile_; | 156 Profile* profile_; |
| 158 | 157 |
| 159 DISALLOW_COPY_AND_ASSIGN(UserScriptMaster); | 158 DISALLOW_COPY_AND_ASSIGN(UserScriptMaster); |
| 160 }; | 159 }; |
| 161 | 160 |
| 162 #endif // CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ | 161 #endif // CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ |
| OLD | NEW |