Chromium Code Reviews| Index: chrome/browser/extensions/declarative_user_script_manager.h |
| diff --git a/chrome/browser/extensions/declarative_user_script_manager.h b/chrome/browser/extensions/declarative_user_script_manager.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8985d54410b401386d125fc882292292108c0f1a |
| --- /dev/null |
| +++ b/chrome/browser/extensions/declarative_user_script_manager.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_DECLARATIVE_USER_SCRIPT_MANAGER_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_DECLARATIVE_USER_SCRIPT_MANAGER_H_ |
| + |
|
Devlin
2014/12/12 18:08:07
#include <map>
Xi Han
2014/12/12 19:47:24
Done.
|
| +#include "base/macros.h" |
| +#include "base/memory/linked_ptr.h" |
| +#include "extensions/common/extension.h" |
| + |
| +class Profile; |
| + |
| +namespace extensions { |
| + |
| +class DeclarativeUserScriptMaster; |
| + |
| +class DeclarativeUserScriptManager { |
|
Devlin
2014/12/12 18:08:07
Class comments needed.
Xi Han
2014/12/12 19:47:24
Done.
|
| + public: |
| + explicit DeclarativeUserScriptManager(Profile* profile); |
| + ~DeclarativeUserScriptManager(); |
| + |
| + // 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:)
|
| + DeclarativeUserScriptMaster* GetDeclarativeUserScriptMasterByID( |
| + 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
|
| + |
| + private: |
| + Profile* profile_; |
| + |
| + 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.
|
| + UserScriptMasterMap; |
| + |
| + // 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
|
| + // 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.
|
| + // API is used by an extension to request content scripts. |
| + UserScriptMasterMap declarative_user_script_masters_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DeclarativeUserScriptManager); |
| +}; |
| + |
| +} // extensions |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_DECLARATIVE_USER_SCRIPT_MANAGER_H_ |