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

Unified Diff: chrome/renderer/translate/translate_helper.cc

Issue 14180010: Translate: browser test for Chrome Translate in an isolated world (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix two memory bugs Created 7 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
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | chrome/test/data/translate/fr_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/translate/translate_helper.cc
diff --git a/chrome/renderer/translate/translate_helper.cc b/chrome/renderer/translate/translate_helper.cc
index 8cfc5e3b457692e53294109e90f298361db12b34..d4c5415059d9f435404840b9fe75a928a2e919b2 100644
--- a/chrome/renderer/translate/translate_helper.cc
+++ b/chrome/renderer/translate/translate_helper.cc
@@ -357,9 +357,15 @@ void TranslateHelper::OnTranslatePage(int page_id,
chrome::ISOLATED_WORLD_ID_TRANSLATE,
WebString::fromUTF8(kContentSecurityPolicy));
+ std::string security_origin(kSecurityOrigin);
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kTranslateSecurityOrigin)) {
+ security_origin =
+ command_line->GetSwitchValueASCII(switches::kTranslateSecurityOrigin);
+ }
frame->setIsolatedWorldSecurityOrigin(
chrome::ISOLATED_WORLD_ID_TRANSLATE,
- WebSecurityOrigin::create(GURL(kSecurityOrigin)));
+ WebSecurityOrigin::create(GURL(security_origin)));
}
if (!IsTranslateLibAvailable()) {
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | chrome/test/data/translate/fr_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698