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

Side by Side Diff: chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.cc

Issue 16625012: Remove ExtensionURLInfo, make security decisions in render process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address feedback Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/tab_contents/tab_util.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" 5 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 if (!origin_url.has_host()) { 244 if (!origin_url.has_host()) {
245 return l10n_util::GetStringUTF16( 245 return l10n_util::GetStringUTF16(
246 is_alert ? IDS_JAVASCRIPT_ALERT_DEFAULT_TITLE 246 is_alert ? IDS_JAVASCRIPT_ALERT_DEFAULT_TITLE
247 : IDS_JAVASCRIPT_MESSAGEBOX_DEFAULT_TITLE); 247 : IDS_JAVASCRIPT_MESSAGEBOX_DEFAULT_TITLE);
248 } 248 }
249 249
250 // If the URL is a chrome extension one, return the extension name. 250 // If the URL is a chrome extension one, return the extension name.
251 if (extension_host_) { 251 if (extension_host_) {
252 const extensions::Extension* extension = extension_host_-> 252 const extensions::Extension* extension = extension_host_->
253 profile()->GetExtensionService()->extensions()-> 253 profile()->GetExtensionService()->extensions()->
254 GetExtensionOrAppByURL(ExtensionURLInfo(origin_url)); 254 GetExtensionOrAppByURL(origin_url);
255 if (extension) { 255 if (extension) {
256 return UTF8ToUTF16(base::StringPiece(extension->name())); 256 return UTF8ToUTF16(base::StringPiece(extension->name()));
257 } 257 }
258 } 258 }
259 259
260 // Otherwise, return the formatted URL. 260 // Otherwise, return the formatted URL.
261 // In this case, force URL to have LTR directionality. 261 // In this case, force URL to have LTR directionality.
262 string16 url_string = net::FormatUrl(origin_url, accept_lang); 262 string16 url_string = net::FormatUrl(origin_url, accept_lang);
263 return l10n_util::GetStringFUTF16( 263 return l10n_util::GetStringFUTF16(
264 is_alert ? IDS_JAVASCRIPT_ALERT_TITLE 264 is_alert ? IDS_JAVASCRIPT_ALERT_TITLE
(...skipping 26 matching lines...) Expand all
291 } // namespace 291 } // namespace
292 292
293 content::JavaScriptDialogManager* GetJavaScriptDialogManagerInstance() { 293 content::JavaScriptDialogManager* GetJavaScriptDialogManagerInstance() {
294 return ChromeJavaScriptDialogManager::GetInstance(); 294 return ChromeJavaScriptDialogManager::GetInstance();
295 } 295 }
296 296
297 content::JavaScriptDialogManager* CreateJavaScriptDialogManagerInstance( 297 content::JavaScriptDialogManager* CreateJavaScriptDialogManagerInstance(
298 extensions::ExtensionHost* extension_host) { 298 extensions::ExtensionHost* extension_host) {
299 return new ChromeJavaScriptDialogManager(extension_host); 299 return new ChromeJavaScriptDialogManager(extension_host);
300 } 300 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_util.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698