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

Side by Side Diff: chrome/browser/ui/webui/cloud_print_signin_dialog.cc

Issue 8949061: Move a bunch of methods from TabContents into the WebContents interface. This change either moves... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { 78 if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) {
79 GURL url = web_ui_->tab_contents()->GetURL(); 79 GURL url = web_ui_->tab_contents()->GetURL();
80 GURL dialog_url = CloudPrintURL( 80 GURL dialog_url = CloudPrintURL(
81 Profile::FromWebUI(web_ui_)).GetCloudPrintServiceURL(); 81 Profile::FromWebUI(web_ui_)).GetCloudPrintServiceURL();
82 if (url.host() == dialog_url.host() && 82 if (url.host() == dialog_url.host() &&
83 url.path() == dialog_url.path() && 83 url.path() == dialog_url.path() &&
84 url.scheme() == dialog_url.scheme()) { 84 url.scheme() == dialog_url.scheme()) {
85 StoreDialogSize(); 85 StoreDialogSize();
86 web_ui_->tab_contents()->GetRenderViewHost()->ClosePage(); 86 web_ui_->tab_contents()->GetRenderViewHost()->ClosePage();
87 static_cast<PrintPreviewUI*>( 87 static_cast<PrintPreviewUI*>(
88 parent_tab_->web_ui())->OnReloadPrintersList(); 88 parent_tab_->GetWebUI())->OnReloadPrintersList();
89 } 89 }
90 } 90 }
91 } 91 }
92 92
93 void CloudPrintSigninFlowHandler::StoreDialogSize() { 93 void CloudPrintSigninFlowHandler::StoreDialogSize() {
94 if (web_ui_ && web_ui_->tab_contents() && web_ui_->tab_contents()->GetView()) { 94 if (web_ui_ && web_ui_->tab_contents() && web_ui_->tab_contents()->GetView()) {
95 gfx::Size size = web_ui_->tab_contents()->GetView()->GetContainerSize(); 95 gfx::Size size = web_ui_->tab_contents()->GetView()->GetContainerSize();
96 Profile* profile = Profile::FromWebUI(web_ui_); 96 Profile* profile = Profile::FromWebUI(web_ui_);
97 profile->GetPrefs()->SetInteger(prefs::kCloudPrintSigninDialogWidth, 97 profile->GetPrefs()->SetInteger(prefs::kCloudPrintSigninDialogWidth,
98 size.width()); 98 size.width());
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } 188 }
189 189
190 void CreateCloudPrintSigninDialog(TabContents* parent_tab) { 190 void CreateCloudPrintSigninDialog(TabContents* parent_tab) {
191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
192 192
193 BrowserThread::PostTask( 193 BrowserThread::PostTask(
194 BrowserThread::UI, FROM_HERE, 194 BrowserThread::UI, FROM_HERE,
195 base::Bind(&CreateCloudPrintSigninDialogImpl, parent_tab)); 195 base::Bind(&CreateCloudPrintSigninDialogImpl, parent_tab));
196 } 196 }
197 } // namespace cloud_print_signin_dialog 197 } // namespace cloud_print_signin_dialog
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc ('k') | chrome/browser/ui/webui/html_dialog_tab_contents_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698