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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/file_browser_handlers.cc

Issue 23463007: file_manager: Fix a bug where hosted documents could not be opened without active browser window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 | « no previous file | chrome/browser/chromeos/extensions/file_manager/open_with_browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/file_manager/file_browser_handlers.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_handlers.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_handlers.cc
index 1519e4536075f33df6040ed7f517593c706dfba5..e120ba6e84ff1e7ad2ad876d79269b977953231c 100644
--- a/chrome/browser/chromeos/extensions/file_manager/file_browser_handlers.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_handlers.cc
@@ -479,23 +479,16 @@ bool ShouldBeOpenedWithBrowser(const std::string& extension_id,
action_id == "open-hosted-gslides"));
}
-// Opens the files specified by |file_urls| with the browser. |profile| is
-// used for finding an active browser. Returns true on success. It's a
-// failure if no files are opened.
+// Opens the files specified by |file_urls| with the browser for |profile|.
+// Returns true on success. It's a failure if no files are opened.
bool OpenFilesWithBrowser(Profile* profile,
const std::vector<FileSystemURL>& file_urls) {
- Browser* browser = chrome::FindLastActiveWithProfile(
- profile,
- chrome::HOST_DESKTOP_TYPE_ASH);
- if (!browser)
- return false;
-
int num_opened = 0;
for (size_t i = 0; i < file_urls.size(); ++i) {
const FileSystemURL& file_url = file_urls[i];
if (chromeos::FileSystemBackend::CanHandleURL(file_url)) {
const base::FilePath& file_path = file_url.path();
- num_opened += util::OpenFileWithBrowser(browser, file_path);
+ num_opened += util::OpenFileWithBrowser(profile, file_path);
}
}
return num_opened > 0;
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/open_with_browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698