| 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 =
|
|
|