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

Unified Diff: chrome/browser/ui/views/file_manager_dialog.cc

Issue 7941014: Use extension-based file picker from CrOS for Aura builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux_touchui Created 9 years, 3 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/browser/ui/browser.cc ('k') | chrome/browser/ui/views/shell_dialogs_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/file_manager_dialog.cc
diff --git a/chrome/browser/ui/views/file_manager_dialog.cc b/chrome/browser/ui/views/file_manager_dialog.cc
index e7f156469eb72f9c2d42d52acb2a2baddcfce180..cc2dc013ddfe2c22a6fa23ea217321d0e736f59c 100644
--- a/chrome/browser/ui/views/file_manager_dialog.cc
+++ b/chrome/browser/ui/views/file_manager_dialog.cc
@@ -73,6 +73,7 @@ FileManagerDialog* PendingDialog::Find(int32 tab_id) {
// Linking this implementation of SelectFileDialog::Create into the target
// selects FileManagerDialog as the dialog of choice.
+// TODO(jamescook): Move this into a new file shell_dialogs_chromeos.cc
// static
SelectFileDialog* SelectFileDialog::Create(Listener* listener) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -182,19 +183,24 @@ void FileManagerDialog::SelectFileImpl(
virtual_path = FilePath();
}
- // Connect our listener to FileDialogFunction's per-tab callbacks.
- TabContentsWrapper* tab = owner_browser->GetSelectedTabContentsWrapper();
- int32 tab_id = (tab ? tab->restore_tab_helper()->session_id().id() : 0);
- PendingDialog::Add(tab_id, this);
-
GURL file_browser_url = FileManagerUtil::GetFileBrowserUrlWithParams(
type, title, virtual_path, file_types, file_type_index,
default_extension);
- extension_dialog_ = ExtensionDialog::Show(file_browser_url,
+ TabContentsWrapper* tab = owner_browser->GetSelectedTabContentsWrapper();
+ ExtensionDialog* dialog = ExtensionDialog::Show(file_browser_url,
owner_browser, tab->tab_contents(),
kFileManagerWidth, kFileManagerHeight,
this /* ExtensionDialog::Observer */);
+ if (!dialog) {
+ LOG(ERROR) << "Unable to create extension dialog";
+ return;
+ }
+
+ // Connect our listener to FileDialogFunction's per-tab callbacks.
+ int32 tab_id = (tab ? tab->restore_tab_helper()->session_id().id() : 0);
+ PendingDialog::Add(tab_id, this);
+ extension_dialog_ = dialog;
params_ = params;
tab_id_ = tab_id;
owner_window_ = owner_window;
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/views/shell_dialogs_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698