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

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

Issue 603033002: Get FileSelect dialog work on athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reformat Created 6 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
Index: chrome/browser/ui/views/select_file_dialog_extension.cc
diff --git a/chrome/browser/ui/views/select_file_dialog_extension.cc b/chrome/browser/ui/views/select_file_dialog_extension.cc
index f61fa37652dc61dd68c5e8cc685dc0d668d501d0..abd33f9dc176b4b13e0a1dc2c3fa8bb5f4d1ef6b 100644
--- a/chrome/browser/ui/views/select_file_dialog_extension.cc
+++ b/chrome/browser/ui/views/select_file_dialog_extension.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/browser/ui/host_desktop.h"
@@ -39,6 +38,10 @@
#include "ui/shell_dialogs/selected_file_info.h"
#include "ui/views/widget/widget.h"
+#if defined(USE_ATHENA)
+#include "chrome/browser/ui/views/athena/athena_util.h"
+#endif // USE_ATHENA
+
using extensions::AppWindow;
using content::BrowserThread;
@@ -93,18 +96,22 @@ scoped_refptr<SelectFileDialogExtension> PendingDialog::Find(
return it->second;
}
-
+#if defined(USE_ATHENA)
+void FindRuntimeContext(gfx::NativeWindow owner_window,
+ ui::BaseWindow** base_window,
+ content::WebContents** web_contents) {
+ *base_window = NULL;
+ *web_contents = GetWebContentsForWindow(owner_window);
+}
+#else // USE_ATHENA
// Given |owner_window| finds corresponding |base_window|, it's associated
// |web_contents| and |profile|.
-void FindRuntimeContext(
- gfx::NativeWindow owner_window,
- ui::BaseWindow** base_window,
- content::WebContents** web_contents,
- Profile** profile) {
+void FindRuntimeContext(gfx::NativeWindow owner_window,
+ ui::BaseWindow** base_window,
+ content::WebContents** web_contents) {
*base_window = NULL;
*web_contents = NULL;
- *profile = NULL;
- // To get the base_window and profile, either a Browser or AppWindow is
+ // To get the base_window and web contents, either a Browser or AppWindow is
// needed.
Browser* owner_browser = NULL;
AppWindow* app_window = NULL;
@@ -145,8 +152,8 @@ void FindRuntimeContext(
*web_contents = chromeos::LoginWebDialog::GetCurrentWebContents();
CHECK(web_contents);
- *profile = Profile::FromBrowserContext((*web_contents)->GetBrowserContext());
}
+#endif // USE_ATHENA
} // namespace
@@ -335,8 +342,9 @@ void SelectFileDialogExtension::SelectFileImpl(
// The web contents to associate the dialog with.
content::WebContents* web_contents = NULL;
-
- FindRuntimeContext(owner_window, &base_window, &web_contents, &profile_);
+ FindRuntimeContext(owner_window, &base_window, &web_contents);
+ CHECK(web_contents);
+ profile_ = Profile::FromBrowserContext(web_contents->GetBrowserContext());
CHECK(profile_);
// Check if we have another dialog opened for the contents. It's unlikely, but
« no previous file with comments | « chrome/browser/ui/views/athena/chrome_browser_main_extra_parts_athena.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698