Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use 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_DECLARATIVE_USER_SCRIPT_MANAGER_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_DECLARATIVE_USER_SCRIPT_MANAGER_H_ | |
| 7 | |
|
Devlin
2014/12/12 18:08:07
#include <map>
Xi Han
2014/12/12 19:47:24
Done.
| |
| 8 #include "base/macros.h" | |
| 9 #include "base/memory/linked_ptr.h" | |
| 10 #include "extensions/common/extension.h" | |
| 11 | |
| 12 class Profile; | |
| 13 | |
| 14 namespace extensions { | |
| 15 | |
| 16 class DeclarativeUserScriptMaster; | |
| 17 | |
| 18 class DeclarativeUserScriptManager { | |
|
Devlin
2014/12/12 18:08:07
Class comments needed.
Xi Han
2014/12/12 19:47:24
Done.
| |
| 19 public: | |
| 20 explicit DeclarativeUserScriptManager(Profile* profile); | |
| 21 ~DeclarativeUserScriptManager(); | |
| 22 | |
| 23 // Get the user script master for declarative scripts, if any. | |
|
Devlin
2014/12/12 18:08:07
This "if any" is misleading - it implies this coul
Xi Han
2014/12/12 19:47:24
Good catch, updated:)
| |
| 24 DeclarativeUserScriptMaster* GetDeclarativeUserScriptMasterByID( | |
| 25 const ExtensionId& extension_id); | |
|
Devlin
2014/12/12 18:08:07
I'm slightly confused on passing in an ExtensionId
Xi Han
2014/12/12 19:47:24
I planed this CL only moves code around, but I can
| |
| 26 | |
| 27 private: | |
| 28 Profile* profile_; | |
| 29 | |
| 30 typedef std::map<ExtensionId, linked_ptr<DeclarativeUserScriptMaster>> | |
|
Devlin
2014/12/12 18:08:07
nit: typedefs before class members.
Devlin
2014/12/12 18:08:07
nit: we now prefer C++ 11 style for these:
using U
Xi Han
2014/12/12 19:47:24
Thanks for pointing it out:)
Xi Han
2014/12/12 19:47:24
Moved.
| |
| 31 UserScriptMasterMap; | |
| 32 | |
| 33 // Shared memory region manager for programmatically declared scripts. | |
|
Devlin
2014/12/12 18:08:07
I'm not sure what the "Shared memory region" refer
Xi Han
2014/12/12 19:47:24
I think it is refer to base::SharedMemory, since t
| |
| 34 // Managers are instantiated the first time the declarative | |
|
Devlin
2014/12/12 18:08:07
nit: s/the first time..../lazily.
Xi Han
2014/12/12 19:47:24
Done.
| |
| 35 // API is used by an extension to request content scripts. | |
| 36 UserScriptMasterMap declarative_user_script_masters_; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(DeclarativeUserScriptManager); | |
| 39 }; | |
| 40 | |
| 41 } // extensions | |
| 42 | |
| 43 #endif // CHROME_BROWSER_EXTENSIONS_DECLARATIVE_USER_SCRIPT_MANAGER_H_ | |
| OLD | NEW |