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

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: 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
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..f60189276c10ab5c95c2638cd69d501b26edcbec 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -261,18 +261,19 @@ 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::FromBrowserContext(web_ui_->tab_contents()->browser_context());
+ pending_entry->set_url(
+ CloudPrintURL(profile).GetCloudPrintServiceDialogURL());
}
+ registrar_.Add(this, content::NOTIFICATION_LOAD_STOP,
+ Source<NavigationController>(controller));
}
void CloudPrintFlowHandler::Observe(int type,
@@ -282,8 +283,9 @@ void CloudPrintFlowHandler::Observe(int type,
// Take the opportunity to set some (minimal) additional
// script permissions required for the web UI.
GURL url = web_ui_->tab_contents()->GetURL();
- GURL dialog_url = CloudPrintURL(
- web_ui_->GetProfile()).GetCloudPrintServiceDialogURL();
+ Profile* profile =
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
+ GURL dialog_url = CloudPrintURL(profile).GetCloudPrintServiceDialogURL();
if (url.host() == dialog_url.host() &&
url.path() == dialog_url.path() &&
url.scheme() == dialog_url.scheme()) {
@@ -392,10 +394,12 @@ 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::FromBrowserContext(web_ui_->tab_contents()->browser_context());
+ profile->GetPrefs()->SetInteger(prefs::kCloudPrintDialogWidth,
+ size.width());
+ profile->GetPrefs()->SetInteger(prefs::kCloudPrintDialogHeight,
+ size.height());
}
}

Powered by Google App Engine
This is Rietveld 408576698