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

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

Issue 9003014: Replace WebUI::tab_contents() with web_contents() and switch all users to use web_contents.h inst... (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc ('k') | chrome/browser/profiles/profile.cc » ('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
===================================================================
--- chrome/browser/printing/print_dialog_cloud.cc (revision 116011)
+++ chrome/browser/printing/print_dialog_cloud.cc (working copy)
@@ -22,12 +22,13 @@
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/dialog_style.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/print_messages.h"
#include "chrome/common/url_constants.h"
#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/tab_contents/tab_contents.h"
+#include "content/browser/tab_contents/navigation_controller.h"
#include "content/browser/tab_contents/tab_contents_view.h"
#include "content/browser/webui/web_ui.h"
#include "content/public/browser/browser_thread.h"
@@ -35,6 +36,7 @@
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
#include "webkit/glue/webpreferences.h"
@@ -300,7 +302,7 @@
// 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()->GetController();
+ NavigationController* controller = &web_ui()->web_contents()->GetController();
NavigationEntry* pending_entry = controller->GetPendingEntry();
if (pending_entry) {
Profile* profile = Profile::FromWebUI(web_ui());
@@ -318,13 +320,13 @@
if (type == content::NOTIFICATION_LOAD_STOP) {
// Take the opportunity to set some (minimal) additional
// script permissions required for the web UI.
- GURL url = web_ui()->tab_contents()->GetURL();
+ GURL url = web_ui()->web_contents()->GetURL();
GURL dialog_url = CloudPrintURL(
Profile::FromWebUI(web_ui())).GetCloudPrintServiceDialogURL();
if (url.host() == dialog_url.host() &&
url.path() == dialog_url.path() &&
url.scheme() == dialog_url.scheme()) {
- RenderViewHost* rvh = web_ui()->tab_contents()->GetRenderViewHost();
+ RenderViewHost* rvh = web_ui()->web_contents()->GetRenderViewHost();
if (rvh && rvh->delegate()) {
WebPreferences webkit_prefs = rvh->delegate()->GetWebkitPrefs();
webkit_prefs.allow_scripts_to_close_windows = true;
@@ -350,7 +352,7 @@
void CloudPrintFlowHandler::ShowDebugger() {
if (web_ui()) {
- RenderViewHost* rvh = web_ui()->tab_contents()->GetRenderViewHost();
+ RenderViewHost* rvh = web_ui()->web_contents()->GetRenderViewHost();
if (rvh)
DevToolsWindow::OpenDevToolsWindow(rvh);
}
@@ -428,9 +430,9 @@
}
void CloudPrintFlowHandler::StoreDialogClientSize() const {
- if (web_ui() && web_ui()->tab_contents() &&
- web_ui()->tab_contents()->GetView()) {
- gfx::Size size = web_ui()->tab_contents()->GetView()->GetContainerSize();
+ if (web_ui() && web_ui()->web_contents() &&
+ web_ui()->web_contents()->GetView()) {
+ gfx::Size size = web_ui()->web_contents()->GetView()->GetContainerSize();
Profile* profile = Profile::FromWebUI(web_ui());
profile->GetPrefs()->SetInteger(prefs::kCloudPrintDialogWidth,
size.width());
@@ -600,9 +602,12 @@
string16 job_title = print_job_title;
Profile* profile = NULL;
if (modal) {
- DCHECK(browser);
- if (job_title.empty() && browser->GetSelectedTabContents())
- job_title = browser->GetSelectedTabContents()->GetTitle();
+ if (job_title.empty()) {
+ WebContents* web_contents =
+ browser->GetSelectedTabContentsWrapper()->web_contents();
+ if (web_contents)
+ job_title = web_contents->GetTitle();
+ }
profile = browser->GetProfile();
} else {
std::vector<Profile*> loaded_profiles =
« no previous file with comments | « chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc ('k') | chrome/browser/profiles/profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698