diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-28 14:52:14 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-28 14:52:14 +0000 |
commit | be2510c02f438cf2887985e7a9c4780ad8aedc01 (patch) | |
tree | fd051f9ae7750fa2b4c6a485bd1f35be299404fb /content | |
parent | 25d97a94a2dd12cc3746affc51b93ef6681b2113 (diff) | |
download | chromium_src-be2510c02f438cf2887985e7a9c4780ad8aedc01.zip chromium_src-be2510c02f438cf2887985e7a9c4780ad8aedc01.tar.gz chromium_src-be2510c02f438cf2887985e7a9c4780ad8aedc01.tar.bz2 |
content: Move javascript_message_type.h into content/ from ui/.
BUG=98716
R=jam@chromium.org
TBR=pkasting@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10451047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
18 files changed, 64 insertions, 46 deletions
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; |