diff options
26 files changed, 89 insertions, 91 deletions
diff --git a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc index 44dcb5d..261a8fc 100644 --- a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc +++ b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc @@ -55,7 +55,7 @@ JavaScriptAppModalDialog::JavaScriptAppModalDialog( WebContents* web_contents, ChromeJavaScriptDialogExtraData* extra_data, const string16& title, - ui::JavascriptMessageType javascript_message_type, + content::JavaScriptMessageType javascript_message_type, const string16& message_text, const string16& default_prompt_text, bool display_suppress_checkbox, diff --git a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h index ef2a053..bb1c38c 100644 --- a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h +++ b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h @@ -32,7 +32,7 @@ class JavaScriptAppModalDialog : public AppModalDialog { content::WebContents* web_contents, ChromeJavaScriptDialogExtraData* extra_data, const string16& title, - ui::JavascriptMessageType javascript_message_type, + content::JavaScriptMessageType javascript_message_type, const string16& message_text, const string16& default_prompt_text, bool display_suppress_checkbox, @@ -59,7 +59,7 @@ class JavaScriptAppModalDialog : public AppModalDialog { void SetOverridePromptText(const string16& prompt_text); // Accessors - ui::JavascriptMessageType javascript_message_type() const { + content::JavaScriptMessageType javascript_message_type() const { return javascript_message_type_; } string16 message_text() const { return message_text_; } @@ -77,7 +77,7 @@ class JavaScriptAppModalDialog : public AppModalDialog { ChromeJavaScriptDialogExtraData* extra_data_; // Information about the message box is held in the following variables. - const ui::JavascriptMessageType javascript_message_type_; + const content::JavaScriptMessageType javascript_message_type_; string16 message_text_; string16 default_prompt_text_; bool display_suppress_checkbox_; diff --git a/chrome/browser/ui/app_modal_dialogs/javascript_dialog_creator.cc b/chrome/browser/ui/app_modal_dialogs/javascript_dialog_creator.cc index f4e610c8..2e542dc 100644 --- a/chrome/browser/ui/app_modal_dialogs/javascript_dialog_creator.cc +++ b/chrome/browser/ui/app_modal_dialogs/javascript_dialog_creator.cc @@ -20,9 +20,9 @@ #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_service.h" #include "content/public/common/content_client.h" +#include "content/public/common/javascript_message_type.h" #include "grit/generated_resources.h" #include "net/base/net_util.h" -#include "ui/base/javascript_message_type.h" #include "ui/base/l10n/l10n_util.h" using content::JavaScriptDialogCreator; @@ -42,7 +42,7 @@ class ChromeJavaScriptDialogCreator : public JavaScriptDialogCreator, WebContents* web_contents, const GURL& origin_url, const std::string& accept_lang, - ui::JavascriptMessageType javascript_message_type, + content::JavaScriptMessageType message_type, const string16& message_text, const string16& default_prompt_text, const DialogClosedCallback& callback, @@ -121,7 +121,7 @@ void ChromeJavaScriptDialogCreator::RunJavaScriptDialog( WebContents* web_contents, const GURL& origin_url, const std::string& accept_lang, - ui::JavascriptMessageType javascript_message_type, + content::JavaScriptMessageType message_type, const string16& message_text, const string16& default_prompt_text, const DialogClosedCallback& callback, @@ -147,7 +147,7 @@ void ChromeJavaScriptDialogCreator::RunJavaScriptDialog( display_suppress_checkbox = true; } - bool is_alert = javascript_message_type == ui::JAVASCRIPT_MESSAGE_TYPE_ALERT; + bool is_alert = message_type == content::JAVASCRIPT_MESSAGE_TYPE_ALERT; string16 dialog_title = GetTitle(origin_url, accept_lang, is_alert); if (extension_host_) @@ -157,7 +157,7 @@ void ChromeJavaScriptDialogCreator::RunJavaScriptDialog( web_contents, extra_data, dialog_title, - javascript_message_type, + message_type, message_text, default_prompt_text, display_suppress_checkbox, @@ -189,7 +189,7 @@ void ChromeJavaScriptDialogCreator::RunBeforeUnloadDialog( web_contents, extra_data, title, - ui::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, + content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, full_message, string16(), // default_prompt_text false, // display_suppress_checkbox diff --git a/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm b/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm index ed17447..108e815 100644 --- a/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm @@ -103,10 +103,10 @@ JavaScriptAppModalDialogCocoa::JavaScriptAppModalDialogCocoa( bool text_field = false; bool one_button = false; switch (dialog_->javascript_message_type()) { - case ui::JAVASCRIPT_MESSAGE_TYPE_ALERT: + case content::JAVASCRIPT_MESSAGE_TYPE_ALERT: one_button = true; break; - case ui::JAVASCRIPT_MESSAGE_TYPE_CONFIRM: + case content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM: if (dialog_->is_before_unload_dialog()) { if (dialog_->is_reload()) { default_button = l10n_util::GetNSStringWithFixup( @@ -121,7 +121,7 @@ JavaScriptAppModalDialogCocoa::JavaScriptAppModalDialogCocoa( } } break; - case ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT: + case content::JAVASCRIPT_MESSAGE_TYPE_PROMPT: text_field = true; break; diff --git a/chrome/browser/ui/gtk/javascript_app_modal_dialog_gtk.cc b/chrome/browser/ui/gtk/javascript_app_modal_dialog_gtk.cc index 455156a..2b78234 100644 --- a/chrome/browser/ui/gtk/javascript_app_modal_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/javascript_app_modal_dialog_gtk.cc @@ -57,12 +57,12 @@ JavaScriptAppModalDialogGtk::JavaScriptAppModalDialogGtk( // We add in the OK button manually later because we want to focus it // explicitly. switch (dialog_->javascript_message_type()) { - case ui::JAVASCRIPT_MESSAGE_TYPE_ALERT: + case content::JAVASCRIPT_MESSAGE_TYPE_ALERT: buttons = GTK_BUTTONS_NONE; message_type = GTK_MESSAGE_WARNING; break; - case ui::JAVASCRIPT_MESSAGE_TYPE_CONFIRM: + case content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM: if (dialog_->is_before_unload_dialog()) { // onbeforeunload also uses a confirm prompt, it just has custom // buttons. We add the buttons using gtk_dialog_add_button below. @@ -73,7 +73,7 @@ JavaScriptAppModalDialogGtk::JavaScriptAppModalDialogGtk( message_type = GTK_MESSAGE_QUESTION; break; - case ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT: + case content::JAVASCRIPT_MESSAGE_TYPE_PROMPT: buttons = GTK_BUTTONS_CANCEL; message_type = GTK_MESSAGE_QUESTION; break; @@ -98,7 +98,7 @@ JavaScriptAppModalDialogGtk::JavaScriptAppModalDialogGtk( // Adjust content area as needed. Set up the prompt text entry or // suppression check box. if (dialog_->javascript_message_type() == - ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT) { + content::JAVASCRIPT_MESSAGE_TYPE_PROMPT) { GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(gtk_dialog_)); GtkWidget* text_box = gtk_entry_new(); @@ -139,7 +139,7 @@ JavaScriptAppModalDialogGtk::JavaScriptAppModalDialogGtk( GtkWidget* ok_button = gtk_dialog_add_button(GTK_DIALOG(gtk_dialog_), GTK_STOCK_OK, GTK_RESPONSE_OK); if (dialog_->javascript_message_type() != - ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT) + content::JAVASCRIPT_MESSAGE_TYPE_PROMPT) gtk_widget_grab_focus(ok_button); } @@ -155,13 +155,13 @@ JavaScriptAppModalDialogGtk::~JavaScriptAppModalDialogGtk() { int JavaScriptAppModalDialogGtk::GetAppModalDialogButtons() const { switch (dialog_->javascript_message_type()) { - case ui::JAVASCRIPT_MESSAGE_TYPE_ALERT: + case content::JAVASCRIPT_MESSAGE_TYPE_ALERT: return ui::DIALOG_BUTTON_OK; - case ui::JAVASCRIPT_MESSAGE_TYPE_CONFIRM: + case content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM: return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; - case ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT: + case content::JAVASCRIPT_MESSAGE_TYPE_PROMPT: return ui::DIALOG_BUTTON_OK; default: diff --git a/chrome/browser/ui/views/javascript_app_modal_dialog_views.cc b/chrome/browser/ui/views/javascript_app_modal_dialog_views.cc index 80ba0e2..b150525 100644 --- a/chrome/browser/ui/views/javascript_app_modal_dialog_views.cc +++ b/chrome/browser/ui/views/javascript_app_modal_dialog_views.cc @@ -20,7 +20,8 @@ JavaScriptAppModalDialogViews::JavaScriptAppModalDialogViews( JavaScriptAppModalDialog* parent) : parent_(parent) { int options = views::MessageBoxView::DETECT_DIRECTIONALITY; - if (parent->javascript_message_type() == ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT) + if (parent->javascript_message_type() == + content::JAVASCRIPT_MESSAGE_TYPE_PROMPT) options |= views::MessageBoxView::HAS_PROMPT_FIELD; views::MessageBoxView::InitParams params(parent->message_text()); @@ -76,7 +77,8 @@ int JavaScriptAppModalDialogViews::GetDefaultDialogButton() const { } int JavaScriptAppModalDialogViews::GetDialogButtons() const { - if (parent_->javascript_message_type() == ui::JAVASCRIPT_MESSAGE_TYPE_ALERT) + if (parent_->javascript_message_type() == + content::JAVASCRIPT_MESSAGE_TYPE_ALERT) return ui::DIALOG_BUTTON_OK; return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h index bfb664a..f550553 100644 --- a/content/browser/renderer_host/render_view_host_delegate.h +++ b/content/browser/renderer_host/render_view_host_delegate.h @@ -13,10 +13,10 @@ #include "base/process_util.h" #include "base/string16.h" #include "content/common/content_export.h" +#include "content/public/common/javascript_message_type.h" #include "ipc/ipc_channel.h" #include "net/base/load_states.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" -#include "ui/base/javascript_message_type.h" #include "webkit/glue/window_open_disposition.h" class GURL; @@ -245,7 +245,7 @@ class CONTENT_EXPORT RenderViewHostDelegate : public IPC::Channel::Listener { const string16& message, const string16& default_prompt, const GURL& frame_url, - ui::JavascriptMessageType type, + content::JavaScriptMessageType type, IPC::Message* reply_msg, bool* did_suppress_message) {} diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 93de712..1cf31ad 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -1288,7 +1288,7 @@ void RenderViewHostImpl::OnMsgRunJavaScriptMessage( const string16& message, const string16& default_prompt, const GURL& frame_url, - ui::JavascriptMessageType type, + content::JavaScriptMessageType type, IPC::Message* reply_msg) { // While a JS message dialog is showing, tabs in the same process shouldn't // process input events. diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h index f5272a0..101b090 100644 --- a/content/browser/renderer_host/render_view_host_impl.h +++ b/content/browser/renderer_host/render_view_host_impl.h @@ -18,12 +18,12 @@ #include "content/browser/site_instance_impl.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/render_view_host.h" +#include "content/public/common/javascript_message_type.h" #include "content/public/common/window_container_type.h" #include "net/base/load_states.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" -#include "ui/base/javascript_message_type.h" #include "webkit/glue/webaccessibility.h" #include "webkit/glue/window_open_disposition.h" @@ -506,7 +506,7 @@ class CONTENT_EXPORT RenderViewHostImpl void OnMsgRunJavaScriptMessage(const string16& message, const string16& default_prompt, const GURL& frame_url, - ui::JavascriptMessageType type, + content::JavaScriptMessageType type, IPC::Message* reply_msg); void OnMsgRunBeforeUnloadConfirm(const GURL& frame_url, const string16& message, diff --git a/content/browser/web_contents/render_view_host_manager_unittest.cc b/content/browser/web_contents/render_view_host_manager_unittest.cc index 3f16d4e..2def6b3 100644 --- a/content/browser/web_contents/render_view_host_manager_unittest.cc +++ b/content/browser/web_contents/render_view_host_manager_unittest.cc @@ -7,8 +7,8 @@ #include "content/browser/mock_content_browser_client.h" #include "content/browser/renderer_host/test_render_view_host.h" #include "content/browser/site_instance_impl.h" -#include "content/browser/web_contents/navigation_entry_impl.h" #include "content/browser/web_contents/navigation_controller_impl.h" +#include "content/browser/web_contents/navigation_entry_impl.h" #include "content/browser/web_contents/render_view_host_manager.h" #include "content/browser/web_contents/test_web_contents.h" #include "content/common/test_url_constants.h" @@ -18,6 +18,7 @@ #include "content/public/browser/notification_types.h" #include "content/public/browser/web_ui_controller.h" #include "content/public/browser/web_ui_controller_factory.h" +#include "content/public/common/javascript_message_type.h" #include "content/public/common/page_transition_types.h" #include "content/public/common/url_constants.h" #include "content/test/mock_render_process_host.h" @@ -26,7 +27,6 @@ #include "content/test/test_notification_tracker.h" #include "googleurl/src/url_util.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/base/javascript_message_type.h" #include "webkit/glue/webkit_glue.h" using content::BrowserContext; @@ -325,7 +325,7 @@ TEST_F(RenderViewHostManagerTest, FilterMessagesWhileSwappedOut) { ntp_process_host->sink().ClearMessages(); ViewHostMsg_RunJavaScriptMessage js_msg( rvh()->GetRoutingID(), msg, msg, kNtpUrl, - ui::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, &result, &unused); + content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, &result, &unused); js_msg.EnableMessagePumping(); EXPECT_TRUE(ntp_rvh->OnMessageReceived(js_msg)); EXPECT_TRUE(ntp_process_host->sink().GetUniqueMessageMatching(IPC_REPLY_ID)); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 5996870..ecd5674 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -49,8 +49,8 @@ #include "content/public/browser/javascript_dialogs.h" #include "content/public/browser/load_notification_details.h" #include "content/public/browser/navigation_details.h" -#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_details.h" +#include "content/public/browser/notification_service.h" #include "content/public/browser/resource_request_details.h" #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents_delegate.h" @@ -2733,7 +2733,7 @@ void WebContentsImpl::RunJavaScriptMessage( const string16& message, const string16& default_prompt, const GURL& frame_url, - ui::JavascriptMessageType javascript_message_type, + content::JavaScriptMessageType javascript_message_type, IPC::Message* reply_msg, bool* did_suppress_message) { // Suppress JavaScript dialogs when requested. Also suppress messages when diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index 1dc61b3..d4fc8b7 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -334,7 +334,7 @@ class CONTENT_EXPORT WebContentsImpl const string16& message, const string16& default_prompt, const GURL& frame_url, - ui::JavascriptMessageType type, + content::JavaScriptMessageType type, IPC::Message* reply_msg, bool* did_suppress_message) OVERRIDE; virtual void RunBeforeUnloadConfirm(content::RenderViewHost* rvh, diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index 599e700..6afa386 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc @@ -1835,7 +1835,7 @@ TEST_F(WebContentsImplTest, NoJSMessageOnInterstitials) { bool did_suppress_message = false; contents()->RunJavaScriptMessage(contents()->GetRenderViewHost(), ASCIIToUTF16("This is an informative message"), ASCIIToUTF16("OK"), - kGURL, ui::JAVASCRIPT_MESSAGE_TYPE_ALERT, dummy_message, + kGURL, content::JAVASCRIPT_MESSAGE_TYPE_ALERT, dummy_message, &did_suppress_message); EXPECT_TRUE(did_suppress_message); } diff --git a/content/common/view_messages.h b/content/common/view_messages.h index 57966c3..0c414c6 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -16,6 +16,7 @@ #include "content/public/common/context_menu_params.h" #include "content/public/common/file_chooser_params.h" #include "content/public/common/frame_navigate_params.h" +#include "content/public/common/javascript_message_type.h" #include "content/public/common/page_zoom.h" #include "content/public/common/referrer.h" #include "content/public/common/renderer_preferences.h" @@ -30,14 +31,13 @@ #include "media/base/media_log_event.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginAction.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" #include "ui/base/ime/text_input_type.h" -#include "ui/base/javascript_message_type.h" #include "ui/base/range/range.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" @@ -67,13 +67,13 @@ IPC_ENUM_TRAITS(WebKit::WebTextDirection) IPC_ENUM_TRAITS(WebMenuItem::Type) IPC_ENUM_TRAITS(WindowContainerType) IPC_ENUM_TRAITS(content::FileChooserParams::Mode) +IPC_ENUM_TRAITS(content::JavaScriptMessageType) IPC_ENUM_TRAITS(content::PageZoom) IPC_ENUM_TRAITS(content::RendererPreferencesHintingEnum) IPC_ENUM_TRAITS(content::RendererPreferencesSubpixelRenderingEnum) IPC_ENUM_TRAITS(content::StopFindAction) IPC_ENUM_TRAITS(media::MediaLogEvent::Type) IPC_ENUM_TRAITS(ui::TextInputType) -IPC_ENUM_TRAITS(ui::JavascriptMessageType) IPC_STRUCT_TRAITS_BEGIN(EditCommand) IPC_STRUCT_TRAITS_MEMBER(name) @@ -1673,7 +1673,7 @@ IPC_SYNC_MESSAGE_ROUTED4_2(ViewHostMsg_RunJavaScriptMessage, string16 /* in - alert message */, string16 /* in - default prompt */, GURL /* in - originating page URL */, - ui::JavascriptMessageType /* in - type */, + content::JavaScriptMessageType /* in - type */, bool /* out - success */, string16 /* out - user_input field */) diff --git a/content/content_common.gypi b/content/content_common.gypi index abed985..f772d37 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -55,6 +55,7 @@ 'public/common/gpu_info.cc', 'public/common/gpu_info.h', 'public/common/gpu_performance_stats.h', + 'public/common/javascript_message_type.h', 'public/common/main_function_params.h', 'public/common/media_stream_request.cc', 'public/common/media_stream_request.h', diff --git a/content/public/browser/javascript_dialogs.h b/content/public/browser/javascript_dialogs.h index 0e4379f..fdfbb06 100644 --- a/content/public/browser/javascript_dialogs.h +++ b/content/public/browser/javascript_dialogs.h @@ -11,8 +11,8 @@ #include "base/callback.h" #include "base/string16.h" #include "content/common/content_export.h" +#include "content/public/common/javascript_message_type.h" #include "googleurl/src/gurl.h" -#include "ui/base/javascript_message_type.h" #include "ui/gfx/native_widget_types.h" namespace content { @@ -33,7 +33,7 @@ class JavaScriptDialogCreator { WebContents* web_contents, const GURL& origin_url, const std::string& accept_lang, - ui::JavascriptMessageType javascript_message_type, + JavaScriptMessageType javascript_message_type, const string16& message_text, const string16& default_prompt_text, const DialogClosedCallback& callback, diff --git a/content/public/common/javascript_message_type.h b/content/public/common/javascript_message_type.h new file mode 100644 index 0000000..9174a67 --- /dev/null +++ b/content/public/common/javascript_message_type.h @@ -0,0 +1,19 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_PUBLIC_COMMON_JAVASCRIPT_MESSAGE_TYPE_H_ +#define CONTENT_PUBLIC_COMMON_JAVASCRIPT_MESSAGE_TYPE_H_ +#pragma once + +namespace content { + +enum JavaScriptMessageType { + JAVASCRIPT_MESSAGE_TYPE_ALERT, + JAVASCRIPT_MESSAGE_TYPE_CONFIRM, + JAVASCRIPT_MESSAGE_TYPE_PROMPT +}; + +} // namespace content + +#endif // CONTENT_PUBLIC_COMMON_JAVASCRIPT_MESSAGE_TYPE_H_ diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index b133a2c..21cd7f0 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -56,7 +56,9 @@ #include "content/public/renderer/navigation_state.h" #include "content/public/renderer/render_view_observer.h" #include "content/public/renderer/render_view_visitor.h" +#include "content/renderer/browser_plugin/browser_plugin.h" #include "content/renderer/browser_plugin/browser_plugin_channel_manager.h" +#include "content/renderer/browser_plugin/browser_plugin_constants.h" #include "content/renderer/browser_plugin/guest_to_embedder_channel.h" #include "content/renderer/device_orientation_dispatcher.h" #include "content/renderer/devtools_agent.h" @@ -81,8 +83,6 @@ #include "content/renderer/notification_provider.h" #include "content/renderer/p2p/socket_dispatcher.h" #include "content/renderer/plugin_channel_host.h" -#include "content/renderer/browser_plugin/browser_plugin.h" -#include "content/renderer/browser_plugin/browser_plugin_constants.h" #include "content/renderer/render_process.h" #include "content/renderer/render_thread_impl.h" #include "content/renderer/render_widget_fullscreen_pepper.h" @@ -105,10 +105,10 @@ #include "net/base/net_errors.h" #include "net/http/http_util.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObject.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallbacks.h" @@ -161,7 +161,6 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLResponse.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" #include "third_party/skia/include/core/SkBitmap.h" -#include "ui/base/javascript_message_type.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" @@ -1555,7 +1554,7 @@ void RenderViewImpl::LoadNavigationErrorPage( replace); } -bool RenderViewImpl::RunJavaScriptMessage(ui::JavascriptMessageType type, +bool RenderViewImpl::RunJavaScriptMessage(content::JavaScriptMessageType type, const string16& message, const string16& default_value, const GURL& frame_url, @@ -1920,7 +1919,7 @@ bool RenderViewImpl::runFileChooser( void RenderViewImpl::runModalAlertDialog(WebFrame* frame, const WebString& message) { - RunJavaScriptMessage(ui::JAVASCRIPT_MESSAGE_TYPE_ALERT, + RunJavaScriptMessage(content::JAVASCRIPT_MESSAGE_TYPE_ALERT, message, string16(), frame->document().url(), @@ -1929,7 +1928,7 @@ void RenderViewImpl::runModalAlertDialog(WebFrame* frame, bool RenderViewImpl::runModalConfirmDialog(WebFrame* frame, const WebString& message) { - return RunJavaScriptMessage(ui::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, + return RunJavaScriptMessage(content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, message, string16(), frame->document().url(), @@ -1941,7 +1940,7 @@ bool RenderViewImpl::runModalPromptDialog(WebFrame* frame, const WebString& default_value, WebString* actual_value) { string16 result; - bool ok = RunJavaScriptMessage(ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT, + bool ok = RunJavaScriptMessage(content::JAVASCRIPT_MESSAGE_TYPE_PROMPT, message, default_value, frame->document().url(), diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index 7530fb6..64d4f39 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h @@ -25,6 +25,7 @@ #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" #include "content/common/navigation_gesture.h" #include "content/common/view_message_enums.h" +#include "content/public/common/javascript_message_type.h" #include "content/public/common/page_zoom.h" #include "content/public/common/referrer.h" #include "content/public/common/renderer_preferences.h" @@ -48,7 +49,6 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSystem.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsContext3D.h" -#include "ui/base/javascript_message_type.h" #include "ui/surface/transport_dib.h" #include "webkit/glue/webpreferences.h" #include "webkit/media/webmediaplayer_delegate.h" @@ -827,7 +827,7 @@ class RenderViewImpl : public RenderWidget, const content::Referrer& referrer, WebKit::WebNavigationPolicy policy); - bool RunJavaScriptMessage(ui::JavascriptMessageType type, + bool RunJavaScriptMessage(content::JavaScriptMessageType type, const string16& message, const string16& default_value, const GURL& frame_url, diff --git a/content/shell/shell_javascript_dialog.h b/content/shell/shell_javascript_dialog.h index 01e2a5d..d7fc64f 100644 --- a/content/shell/shell_javascript_dialog.h +++ b/content/shell/shell_javascript_dialog.h @@ -24,7 +24,7 @@ class ShellJavaScriptDialog { public: ShellJavaScriptDialog( ShellJavaScriptDialogCreator* creator, - ui::JavascriptMessageType javascript_message_type, + JavaScriptMessageType message_type, const string16& message_text, const string16& default_prompt_text, const JavaScriptDialogCreator::DialogClosedCallback& callback); @@ -40,7 +40,7 @@ class ShellJavaScriptDialog { #if defined(OS_MACOSX) ShellJavaScriptDialogHelper* helper_; // owned #elif defined(OS_WIN) - ui::JavascriptMessageType message_type_; + JavaScriptMessageType message_type_; HWND dialog_win_; string16 message_text_; string16 default_prompt_text_; diff --git a/content/shell/shell_javascript_dialog_creator.cc b/content/shell/shell_javascript_dialog_creator.cc index b0dc5a1..2f950b2 100644 --- a/content/shell/shell_javascript_dialog_creator.cc +++ b/content/shell/shell_javascript_dialog_creator.cc @@ -21,7 +21,7 @@ void ShellJavaScriptDialogCreator::RunJavaScriptDialog( WebContents* web_contents, const GURL& origin_url, const std::string& accept_lang, - ui::JavascriptMessageType javascript_message_type, + JavaScriptMessageType javascript_message_type, const string16& message_text, const string16& default_prompt_text, const DialogClosedCallback& callback, @@ -68,7 +68,7 @@ void ShellJavaScriptDialogCreator::RunBeforeUnloadDialog( ASCIIToUTF16("\n\nIs it OK to leave/reload this page?"); dialog_.reset(new ShellJavaScriptDialog(this, - ui::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, + JAVASCRIPT_MESSAGE_TYPE_CONFIRM, new_message_text, string16(), // default_prompt_text callback)); diff --git a/content/shell/shell_javascript_dialog_creator.h b/content/shell/shell_javascript_dialog_creator.h index 7a99837..c9c9881 100644 --- a/content/shell/shell_javascript_dialog_creator.h +++ b/content/shell/shell_javascript_dialog_creator.h @@ -24,7 +24,7 @@ class ShellJavaScriptDialogCreator : public JavaScriptDialogCreator { WebContents* web_contents, const GURL& origin_url, const std::string& accept_lang, - ui::JavascriptMessageType javascript_message_type, + JavaScriptMessageType javascript_message_type, const string16& message_text, const string16& default_prompt_text, const DialogClosedCallback& callback, diff --git a/content/shell/shell_javascript_dialog_mac.mm b/content/shell/shell_javascript_dialog_mac.mm index 90ad82e..0bf357d 100644 --- a/content/shell/shell_javascript_dialog_mac.mm +++ b/content/shell/shell_javascript_dialog_mac.mm @@ -88,16 +88,14 @@ namespace content { ShellJavaScriptDialog::ShellJavaScriptDialog( ShellJavaScriptDialogCreator* creator, - ui::JavascriptMessageType javascript_message_type, + JavaScriptMessageType message_type, const string16& message_text, const string16& default_prompt_text, const JavaScriptDialogCreator::DialogClosedCallback& callback) : creator_(creator), callback_(callback) { - bool text_field = - javascript_message_type == ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT; - bool one_button = - javascript_message_type == ui::JAVASCRIPT_MESSAGE_TYPE_ALERT; + bool text_field = message_type == JAVASCRIPT_MESSAGE_TYPE_PROMPT; + bool one_button = message_type == JAVASCRIPT_MESSAGE_TYPE_ALERT; helper_ = [[ShellJavaScriptDialogHelper alloc] initHelperWithCreator:creator diff --git a/content/shell/shell_javascript_dialog_win.cc b/content/shell/shell_javascript_dialog_win.cc index 7195ba5..065d0bb 100644 --- a/content/shell/shell_javascript_dialog_win.cc +++ b/content/shell/shell_javascript_dialog_win.cc @@ -13,7 +13,8 @@ namespace content { class ShellJavaScriptDialog; -INT_PTR CALLBACK ShellJavaScriptDialog::DialogProc(HWND dialog, UINT message, +INT_PTR CALLBACK ShellJavaScriptDialog::DialogProc(HWND dialog, + UINT message, WPARAM wparam, LPARAM lparam) { switch (message) { @@ -23,7 +24,7 @@ INT_PTR CALLBACK ShellJavaScriptDialog::DialogProc(HWND dialog, UINT message, reinterpret_cast<ShellJavaScriptDialog*>(lparam); owner->dialog_win_ = dialog; SetDlgItemText(dialog, IDC_DIALOGTEXT, owner->message_text_.c_str()); - if (owner->message_type_ == ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT) + if (owner->message_type_ == JAVASCRIPT_MESSAGE_TYPE_PROMPT) SetDlgItemText(dialog, IDC_PROMPTEDIT, owner->default_prompt_text_.c_str()); break; @@ -48,7 +49,7 @@ INT_PTR CALLBACK ShellJavaScriptDialog::DialogProc(HWND dialog, UINT message, case IDOK: finish = true; result = true; - if (owner->message_type_ == ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT) { + if (owner->message_type_ == JAVASCRIPT_MESSAGE_TYPE_PROMPT) { size_t length = GetWindowTextLength(GetDlgItem(dialog, IDC_PROMPTEDIT)) + 1; GetDlgItemText(dialog, IDC_PROMPTEDIT, @@ -76,7 +77,7 @@ INT_PTR CALLBACK ShellJavaScriptDialog::DialogProc(HWND dialog, UINT message, ShellJavaScriptDialog::ShellJavaScriptDialog( ShellJavaScriptDialogCreator* creator, - ui::JavascriptMessageType javascript_message_type, + JavaScriptMessageType message_type, const string16& message_text, const string16& default_prompt_text, const JavaScriptDialogCreator::DialogClosedCallback& callback) @@ -84,11 +85,11 @@ ShellJavaScriptDialog::ShellJavaScriptDialog( callback_(callback), message_text_(message_text), default_prompt_text_(default_prompt_text), - message_type_(javascript_message_type) { + message_type_(message_type) { int dialog_type; - if (javascript_message_type == ui::JAVASCRIPT_MESSAGE_TYPE_ALERT) + if (message_type == JAVASCRIPT_MESSAGE_TYPE_ALERT) dialog_type = IDD_ALERT; - else if (javascript_message_type == ui::JAVASCRIPT_MESSAGE_TYPE_CONFIRM) + else if (message_type == JAVASCRIPT_MESSAGE_TYPE_CONFIRM) dialog_type = IDD_CONFIRM; else // JAVASCRIPT_MESSAGE_TYPE_PROMPT dialog_type = IDD_PROMPT; diff --git a/ui/base/javascript_message_type.h b/ui/base/javascript_message_type.h deleted file mode 100644 index 03e1a83..0000000 --- a/ui/base/javascript_message_type.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_BASE_JAVASCRIPT_MESSAGE_TYPE_H_ -#define UI_BASE_JAVASCRIPT_MESSAGE_TYPE_H_ -#pragma once - -#include "ui/base/ui_export.h" - -namespace ui { - -enum UI_EXPORT JavascriptMessageType { - JAVASCRIPT_MESSAGE_TYPE_ALERT, - JAVASCRIPT_MESSAGE_TYPE_CONFIRM, - JAVASCRIPT_MESSAGE_TYPE_PROMPT -}; - -} // namespace ui - -#endif // UI_BASE_JAVASCRIPT_MESSAGE_TYPE_H_ @@ -171,7 +171,6 @@ 'base/gtk/scoped_region.cc', 'base/gtk/scoped_region.h', 'base/hit_test.h', - 'base/javascript_message_type.h', 'base/keycodes/keyboard_code_conversion.cc', 'base/keycodes/keyboard_code_conversion.h', 'base/keycodes/keyboard_code_conversion_gtk.cc', |