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

Unified Diff: chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc

Issue 9224002: Make WebUI objects not derive from WebUI. WebUI objects own the controller. This is the ownership... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync to head to clear linux_chromeos browsertest failures Created 8 years, 11 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/sync_promo/sync_promo_ui.cc
===================================================================
--- chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc (revision 117871)
+++ chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc (working copy)
@@ -21,6 +21,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "content/browser/webui/web_ui.h"
#include "content/public/browser/web_contents.h"
#include "googleurl/src/url_util.h"
#include "grit/browser_resources.h"
@@ -105,20 +106,21 @@
} // namespace
-SyncPromoUI::SyncPromoUI(WebContents* contents) : WebUI(contents, this) {
- should_hide_url_ = true;
+SyncPromoUI::SyncPromoUI(WebUI* web_ui) : WebUIController(web_ui) {
+ web_ui->HideURL();
SyncPromoHandler* handler = new SyncPromoHandler(
g_browser_process->profile_manager());
- AddMessageHandler(handler);
+ web_ui->AddMessageHandler(handler);
// Set up the chrome://theme/ source.
+ WebContents* contents = web_ui->web_contents();
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
ThemeSource* theme = new ThemeSource(profile);
profile->GetChromeURLDataManager()->AddDataSource(theme);
// Set up the sync promo source.
- SyncPromoUIHTMLSource* html_source = new SyncPromoUIHTMLSource(this);
+ SyncPromoUIHTMLSource* html_source = new SyncPromoUIHTMLSource(web_ui);
html_source->set_json_path(kStringsJsFile);
html_source->add_resource_path(kSyncPromoJsFile, IDR_SYNC_PROMO_JS);
html_source->set_default_resource(IDR_SYNC_PROMO_HTML);

Powered by Google App Engine
This is Rietveld 408576698