summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 04:13:47 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 04:13:47 +0000
commit01ec4ec8ef85dc181f3744fdb6fd41cab7b00018 (patch)
treee8208faaa428979491fc36130c11c6257ce2a91d /chrome/browser/printing
parentb729f1fca403a7b2424e78fe3257683637e6b1d1 (diff)
downloadchromium_src-01ec4ec8ef85dc181f3744fdb6fd41cab7b00018.zip
chromium_src-01ec4ec8ef85dc181f3744fdb6fd41cab7b00018.tar.gz
chromium_src-01ec4ec8ef85dc181f3744fdb6fd41cab7b00018.tar.bz2
Switch chrome code to use content::WebUI interface instead of WebUI concrete class. The latter will be renamed to WebUIImpl in a followup change. This completes hiding WebUI from chrome code, and now we can block it through DEPS.
BUG=98716 Review URL: https://chromiumcodereview.appspot.com/9241032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118038 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing')
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc8
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_setup_flow.h4
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_setup_message_handler.cc2
-rw-r--r--chrome/browser/printing/print_dialog_cloud.cc16
-rw-r--r--chrome/browser/printing/print_dialog_cloud_internal.h5
-rw-r--r--chrome/browser/printing/print_preview_message_handler.cc2
6 files changed, 19 insertions, 18 deletions
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
index 7572467..0304866 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
@@ -232,7 +232,7 @@ void CloudPrintSetupFlow::OnClientLoginFailure(
///////////////////////////////////////////////////////////////////////////////
// Methods called by CloudPrintSetupMessageHandler
-void CloudPrintSetupFlow::Attach(WebUI* web_ui) {
+void CloudPrintSetupFlow::Attach(content::WebUI* web_ui) {
web_ui_ = web_ui;
}
@@ -265,14 +265,14 @@ void CloudPrintSetupFlow::OnUserClickedLearnMore() {
OpenURLParams params(CloudPrintURL::GetCloudPrintLearnMoreURL(),
Referrer(), NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK, false);
- web_ui_->web_contents()->OpenURL(params);
+ web_ui_->GetWebContents()->OpenURL(params);
}
void CloudPrintSetupFlow::OnUserClickedPrintTestPage() {
OpenURLParams params(CloudPrintURL::GetCloudPrintTestPageURL(),
Referrer(), NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK, false);
- web_ui_->web_contents()->OpenURL(params);
+ web_ui_->GetWebContents()->OpenURL(params);
}
///////////////////////////////////////////////////////////////////////////////
@@ -338,7 +338,7 @@ void CloudPrintSetupFlow::ExecuteJavascriptInIFrame(
const string16& iframe_xpath,
const string16& js) {
if (web_ui_) {
- RenderViewHost* rvh = web_ui_->web_contents()->GetRenderViewHost();
+ RenderViewHost* rvh = web_ui_->GetWebContents()->GetRenderViewHost();
rvh->ExecuteJavascriptInWebFrame(iframe_xpath, js);
}
}
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h
index 8044d70..6510c6e 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h
@@ -99,7 +99,7 @@ class CloudPrintSetupFlow : public HtmlDialogUIDelegate,
// Called CloudPrintSetupMessageHandler when a DOM is attached. This method
// is called when the HTML page is fully loaded. We then operate on this
// WebUI object directly.
- void Attach(WebUI* web_ui);
+ void Attach(content::WebUI* web_ui);
// Called by CloudPrintSetupMessageHandler when user authentication is
// registered.
@@ -124,7 +124,7 @@ class CloudPrintSetupFlow : public HtmlDialogUIDelegate,
// Pointer to the Web UI. This is provided by CloudPrintSetupMessageHandler
// when attached. We do not own the pointer, instead WebUI owns it's delegate
// (us) and controls our lifetime.
- WebUI* web_ui_;
+ content::WebUI* web_ui_;
// The args to pass to the initial page.
std::string dialog_start_args_;
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_message_handler.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_message_handler.cc
index 28581ba..27bd893 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_setup_message_handler.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_message_handler.cc
@@ -10,7 +10,7 @@
#include "base/json/json_writer.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h"
-#include "content/browser/webui/web_ui.h"
+#include "content/public/browser/web_ui.h"
void CloudPrintSetupMessageHandler::RegisterMessages() {
// Pass the WebUI object to the setup flow.
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index d85d48c..98b18c0 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -29,7 +29,6 @@
#include "chrome/common/url_constants.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents_view.h"
-#include "content/browser/webui/web_ui.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
@@ -37,6 +36,7 @@
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_ui.h"
#include "ui/base/l10n/l10n_util.h"
#include "webkit/glue/webpreferences.h"
@@ -311,7 +311,7 @@ void CloudPrintFlowHandler::RegisterMessages() {
// to the real server URL, now that we've gotten an HTML dialog
// going.
NavigationController* controller =
- &web_ui()->web_contents()->GetController();
+ &web_ui()->GetWebContents()->GetController();
NavigationEntry* pending_entry = controller->GetPendingEntry();
if (pending_entry) {
Profile* profile = Profile::FromWebUI(web_ui());
@@ -329,13 +329,13 @@ void CloudPrintFlowHandler::Observe(
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()->web_contents()->GetURL();
+ GURL url = web_ui()->GetWebContents()->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()->web_contents()->GetRenderViewHost();
+ RenderViewHost* rvh = web_ui()->GetWebContents()->GetRenderViewHost();
if (rvh && rvh->delegate()) {
WebPreferences webkit_prefs = rvh->delegate()->GetWebkitPrefs();
webkit_prefs.allow_scripts_to_close_windows = true;
@@ -361,7 +361,7 @@ void CloudPrintFlowHandler::HandleShowDebugger(const ListValue* args) {
void CloudPrintFlowHandler::ShowDebugger() {
if (web_ui()) {
- RenderViewHost* rvh = web_ui()->web_contents()->GetRenderViewHost();
+ RenderViewHost* rvh = web_ui()->GetWebContents()->GetRenderViewHost();
if (rvh)
DevToolsWindow::OpenDevToolsWindow(rvh);
}
@@ -441,9 +441,9 @@ void CloudPrintFlowHandler::HandleSetPageParameters(const ListValue* args) {
}
void CloudPrintFlowHandler::StoreDialogClientSize() const {
- if (web_ui() && web_ui()->web_contents() &&
- web_ui()->web_contents()->GetView()) {
- gfx::Size size = web_ui()->web_contents()->GetView()->GetContainerSize();
+ if (web_ui() && web_ui()->GetWebContents() &&
+ web_ui()->GetWebContents()->GetView()) {
+ gfx::Size size = web_ui()->GetWebContents()->GetView()->GetContainerSize();
Profile* profile = Profile::FromWebUI(web_ui());
profile->GetPrefs()->SetInteger(prefs::kCloudPrintDialogWidth,
size.width());
diff --git a/chrome/browser/printing/print_dialog_cloud_internal.h b/chrome/browser/printing/print_dialog_cloud_internal.h
index 06125a5..a3925aa 100644
--- a/chrome/browser/printing/print_dialog_cloud_internal.h
+++ b/chrome/browser/printing/print_dialog_cloud_internal.h
@@ -31,7 +31,8 @@ namespace internal_cloud_print_helpers {
// Small class to virtualize a few functions to aid with unit testing.
class CloudPrintDataSenderHelper {
public:
- explicit CloudPrintDataSenderHelper(WebUI* web_ui) : web_ui_(web_ui) {}
+ explicit CloudPrintDataSenderHelper(content::WebUI* web_ui)
+ : web_ui_(web_ui) {}
virtual ~CloudPrintDataSenderHelper() {}
// Virtualize the overrides of these three functions from WebUI to
@@ -48,7 +49,7 @@ class CloudPrintDataSenderHelper {
const base::Value& arg3);
private:
- WebUI* web_ui_;
+ content::WebUI* web_ui_;
DISALLOW_COPY_AND_ASSIGN(CloudPrintDataSenderHelper);
};
diff --git a/chrome/browser/printing/print_preview_message_handler.cc b/chrome/browser/printing/print_preview_message_handler.cc
index 696d8a6d..4b605a0 100644
--- a/chrome/browser/printing/print_preview_message_handler.cc
+++ b/chrome/browser/printing/print_preview_message_handler.cc
@@ -19,9 +19,9 @@
#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
#include "chrome/common/print_messages.h"
#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/webui/web_ui.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_ui.h"
#include "printing/page_size_margins.h"
#include "printing/print_job_constants.h"