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

Side by Side Diff: chrome/browser/ui/webui/cloud_print_signin_dialog.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/cloud_print_signin_dialog.h" 5 #include "chrome/browser/ui/webui/cloud_print_signin_dialog.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { 86 if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) {
87 GURL url = web_ui()->web_contents()->GetURL(); 87 GURL url = web_ui()->web_contents()->GetURL();
88 GURL dialog_url = CloudPrintURL( 88 GURL dialog_url = CloudPrintURL(
89 Profile::FromWebUI(web_ui())).GetCloudPrintServiceURL(); 89 Profile::FromWebUI(web_ui())).GetCloudPrintServiceURL();
90 if (url.host() == dialog_url.host() && 90 if (url.host() == dialog_url.host() &&
91 url.path() == dialog_url.path() && 91 url.path() == dialog_url.path() &&
92 url.scheme() == dialog_url.scheme()) { 92 url.scheme() == dialog_url.scheme()) {
93 StoreDialogSize(); 93 StoreDialogSize();
94 web_ui()->web_contents()->GetRenderViewHost()->ClosePage(); 94 web_ui()->web_contents()->GetRenderViewHost()->ClosePage();
95 static_cast<PrintPreviewUI*>( 95 static_cast<PrintPreviewUI*>(
96 parent_tab_->GetWebUI())->OnReloadPrintersList(); 96 parent_tab_->GetWebUI()->GetController())->OnReloadPrintersList();
97 } 97 }
98 } 98 }
99 } 99 }
100 100
101 void CloudPrintSigninFlowHandler::StoreDialogSize() { 101 void CloudPrintSigninFlowHandler::StoreDialogSize() {
102 if (web_ui() && 102 if (web_ui() &&
103 web_ui()->web_contents() && 103 web_ui()->web_contents() &&
104 web_ui()->web_contents()->GetView()) { 104 web_ui()->web_contents()->GetView()) {
105 gfx::Size size = web_ui()->web_contents()->GetView()->GetContainerSize(); 105 gfx::Size size = web_ui()->web_contents()->GetView()->GetContainerSize();
106 Profile* profile = Profile::FromWebUI(web_ui()); 106 Profile* profile = Profile::FromWebUI(web_ui());
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 void CreateCloudPrintSigninDialog(WebContents* parent_tab) { 206 void CreateCloudPrintSigninDialog(WebContents* parent_tab) {
207 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 207 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
208 208
209 BrowserThread::PostTask( 209 BrowserThread::PostTask(
210 BrowserThread::UI, FROM_HERE, 210 BrowserThread::UI, FROM_HERE,
211 base::Bind(&CreateCloudPrintSigninDialogImpl, 211 base::Bind(&CreateCloudPrintSigninDialogImpl,
212 parent_tab->GetRenderProcessHost()->GetID(), 212 parent_tab->GetRenderProcessHost()->GetID(),
213 parent_tab->GetRenderViewHost()->routing_id())); 213 parent_tab->GetRenderViewHost()->routing_id()));
214 } 214 }
215 } // namespace cloud_print_signin_dialog 215 } // namespace cloud_print_signin_dialog
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698