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

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

Issue 2467213002: arc: Implement Read and GetFileSize for ARC content file system (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
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 8697122de5a2c12a5fa4691d38fec20ab0e4b747..0aebfcdcf435ecfa611b3616dd2a9d4d6d260fee 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"
@@ -410,10 +411,17 @@ void ChromeShellDelegate::OpenUrlFromArc(const GURL& url) {
if (!url.is_valid())
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 | « chrome/browser/chromeos/arc/fileapi/intent_helper_util.cc ('k') | components/arc/common/intent_helper.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698