| 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..d45448e71642eb4a6f66296fcbabad59528a33d7 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
|
|
|