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

Unified Diff: chrome/browser/ui/webui/options2/browser_options_handler2.cc

Issue 10535026: Move creation and ownership of DownloadManager from the embedder to content. This matches all the o… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros compile Created 8 years, 6 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/webui/options2/browser_options_handler2.cc
===================================================================
--- chrome/browser/ui/webui/options2/browser_options_handler2.cc (revision 140592)
+++ chrome/browser/ui/webui/options2/browser_options_handler2.cc (working copy)
@@ -98,6 +98,7 @@
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#endif // defined(TOOLKIT_GTK)
+using content::BrowserContext;
using content::BrowserThread;
using content::DownloadManager;
using content::OpenURLParams;
@@ -1058,8 +1059,8 @@
void BrowserOptionsHandler::HandleAutoOpenButton(const ListValue* args) {
content::RecordAction(UserMetricsAction("Options_ResetAutoOpenFiles"));
- DownloadManager* manager =
- web_ui()->GetWebContents()->GetBrowserContext()->GetDownloadManager();
+ DownloadManager* manager = BrowserContext::GetDownloadManager(
+ web_ui()->GetWebContents()->GetBrowserContext());
if (manager)
DownloadPrefs::FromDownloadManager(manager)->ResetAutoOpen();
}
@@ -1369,8 +1370,8 @@
void BrowserOptionsHandler::SetupAutoOpenFileTypes() {
// Set the hidden state for the AutoOpenFileTypesResetToDefault button.
// We show the button if the user has any auto-open file types registered.
- DownloadManager* manager =
- web_ui()->GetWebContents()->GetBrowserContext()->GetDownloadManager();
+ DownloadManager* manager = BrowserContext::GetDownloadManager(
+ web_ui()->GetWebContents()->GetBrowserContext());
bool display = manager &&
DownloadPrefs::FromDownloadManager(manager)->IsAutoOpenUsed();
base::FundamentalValue value(display);

Powered by Google App Engine
This is Rietveld 408576698