Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: chrome/browser/extensions/user_script_master.h

Issue 7552028: Injected CSS localization fix (see bug no.) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/user_script_master.h
diff --git a/chrome/browser/extensions/user_script_master.h b/chrome/browser/extensions/user_script_master.h
index 2df53d8acf5fb433bd7aebae439909bdf6b9a575..1ef6453ffb51a0b9fa2095795ff3ce81abd93e24 100644
--- a/chrome/browser/extensions/user_script_master.h
+++ b/chrome/browser/extensions/user_script_master.h
@@ -6,10 +6,15 @@
#define CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_
#pragma once
+#include <map>
+#include <string>
+
#include "base/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/shared_memory.h"
+#include "chrome/common/extensions/extension_messages.h"
+#include "chrome/common/extensions/extension_set.h"
#include "chrome/common/extensions/user_script.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_observer.h"
@@ -75,7 +80,6 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
}
private:
- private:
FRIEND_TEST_ALL_PREFIXES(UserScriptMasterTest, SkipBOMAtTheBeginning);
FRIEND_TEST_ALL_PREFIXES(UserScriptMasterTest, LeaveBOMNotAtTheBeginning);
friend class base::RefCountedThreadSafe<UserScriptMaster::ScriptReloader>;
@@ -98,12 +102,20 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
// tied to the caller.
void RunLoad(const UserScriptList& user_scripts);
- static void LoadUserScripts(UserScriptList* user_scripts);
+ void LoadUserScripts(UserScriptList* user_scripts);
+
+ // Uses extensions_info_ to build a map of localization messages.
+ // Returns NULL if |extension_id| is invalid.
+ SubstitutionMap* GetLocalizationMessages(std::string extension_id);
// A pointer back to our master.
// May be NULL if DisownMaster() is called.
UserScriptMaster* master_;
+ // Maps extension info needed for localization to an extension ID.
+ std::map<std::string, ExtensionSet::ExtensionPathAndDefaultLocale>
+ extensions_info_;
+
// The message loop to call our master back on.
// Expected to always outlive us.
BrowserThread::ID master_thread_id_;

Powered by Google App Engine
This is Rietveld 408576698