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

Unified Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 2464333004: arc: Convert content: and file: URLs from ARC to externalfile: URLs (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/chrome_shell_delegate.cc
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
index 96f7ad8c785dcd671193f528481026100f707216..a3b2805b2ec410726c4d76e8a8bf04999a5e3391 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
+#include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h"
#include "chrome/browser/chromeos/background/ash_wallpaper_delegate.h"
#include "chrome/browser/chromeos/display/display_configuration_observer.h"
#include "chrome/browser/chromeos/display/display_preferences.h"
@@ -409,10 +410,17 @@ void ChromeShellDelegate::OpenUrlFromArc(const GURL& url) {
if (!url.is_valid())
oshima 2016/11/11 01:13:25 Just curious. Is there any reason why we don't sho
hashimoto 2016/11/11 01:26:19 This code was introduced by yusukes@, I have no id
return;
+ GURL url_to_open = url;
+ if (url.SchemeIs(url::kFileScheme) || url.SchemeIs(url::kContentScheme)) {
+ // Chrome cannot open this URL. Read the contents via ARC content file
+ // system with an external file URL.
+ url_to_open = arc::ArcUrlToExternalFileUrl(url_to_open);
+ }
+
chrome::ScopedTabbedBrowserDisplayer displayer(
ProfileManager::GetActiveUserProfile());
chrome::AddSelectedTabWithURL(
- displayer.browser(), url,
+ displayer.browser(), url_to_open,
ui::PageTransitionFromInt(ui::PAGE_TRANSITION_LINK |
ui::PAGE_TRANSITION_FROM_API));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698