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

Unified Diff: chrome/browser/printing/print_dialog_cloud.cc

Issue 7554008: Removal of Profile from content part 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Profile helper function, rebase Created 9 years, 4 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/printing/cloud_print/cloud_print_setup_flow.h ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_dialog_cloud.cc
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index ddbd4f68cbb471eaac14ec935c54a9d072ddd06e..2312ec1fe06976d66028c9fbf24b42c9578bcfa3 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -261,18 +261,18 @@ void CloudPrintFlowHandler::RegisterMessages() {
"SetPageParameters",
NewCallback(this, &CloudPrintFlowHandler::HandleSetPageParameters));
- if (web_ui_->tab_contents()) {
- // Register for appropriate notifications, and re-direct the URL
- // to the real server URL, now that we've gotten an HTML dialog
- // going.
- NavigationController* controller = &web_ui_->tab_contents()->controller();
- NavigationEntry* pending_entry = controller->pending_entry();
- if (pending_entry)
- pending_entry->set_url(CloudPrintURL(
- web_ui_->GetProfile()).GetCloudPrintServiceDialogURL());
- registrar_.Add(this, content::NOTIFICATION_LOAD_STOP,
- Source<NavigationController>(controller));
+ // Register for appropriate notifications, and re-direct the URL
+ // to the real server URL, now that we've gotten an HTML dialog
+ // going.
+ NavigationController* controller = &web_ui_->tab_contents()->controller();
+ NavigationEntry* pending_entry = controller->pending_entry();
+ if (pending_entry) {
+ Profile* profile = Profile::FromWebUI(web_ui_);
+ pending_entry->set_url(
+ CloudPrintURL(profile).GetCloudPrintServiceDialogURL());
}
+ registrar_.Add(this, content::NOTIFICATION_LOAD_STOP,
+ Source<NavigationController>(controller));
}
void CloudPrintFlowHandler::Observe(int type,
@@ -283,7 +283,7 @@ void CloudPrintFlowHandler::Observe(int type,
// script permissions required for the web UI.
GURL url = web_ui_->tab_contents()->GetURL();
GURL dialog_url = CloudPrintURL(
- web_ui_->GetProfile()).GetCloudPrintServiceDialogURL();
+ Profile::FromWebUI(web_ui_)).GetCloudPrintServiceDialogURL();
if (url.host() == dialog_url.host() &&
url.path() == dialog_url.path() &&
url.scheme() == dialog_url.scheme()) {
@@ -392,10 +392,11 @@ void CloudPrintFlowHandler::HandleSetPageParameters(const ListValue* args) {
void CloudPrintFlowHandler::StoreDialogClientSize() const {
if (web_ui_ && web_ui_->tab_contents() && web_ui_->tab_contents()->view()) {
gfx::Size size = web_ui_->tab_contents()->view()->GetContainerSize();
- web_ui_->GetProfile()->GetPrefs()->SetInteger(
- prefs::kCloudPrintDialogWidth, size.width());
- web_ui_->GetProfile()->GetPrefs()->SetInteger(
- prefs::kCloudPrintDialogHeight, size.height());
+ Profile* profile = Profile::FromWebUI(web_ui_);
+ profile->GetPrefs()->SetInteger(prefs::kCloudPrintDialogWidth,
+ size.width());
+ profile->GetPrefs()->SetInteger(prefs::kCloudPrintDialogHeight,
+ size.height());
}
}
« no previous file with comments | « chrome/browser/printing/cloud_print/cloud_print_setup_flow.h ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698