diff options
40 files changed, 179 insertions, 68 deletions
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index dfc29f5..bd0c3ff 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -53,7 +53,7 @@ #include "chrome/browser/ui/find_bar/find_notification_details.h" #include "chrome/browser/ui/login/login_prompt.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" -#include "chrome/common/automation_constants.h" +#include "chrome/common/automation_messages.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/notification_service.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h index fcb955b..4e0f7c5 100644 --- a/chrome/browser/automation/automation_provider_observers.h +++ b/chrome/browser/automation/automation_provider_observers.h @@ -24,10 +24,11 @@ #include "chrome/browser/password_manager/password_store.h" #include "chrome/browser/search_engines/template_url_model_observer.h" #include "chrome/browser/tabs/tab_strip_model.h" -#include "chrome/common/automation_messages.h" +#include "chrome/common/automation_constants.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/notification_type.h" +#include "ui/gfx/size.h" class AutocompleteEditModel; class AutomationProvider; diff --git a/chrome/browser/debugger/devtools_manager.cc b/chrome/browser/debugger/devtools_manager.cc index 543171b..e7d3b53 100644 --- a/chrome/browser/debugger/devtools_manager.cc +++ b/chrome/browser/debugger/devtools_manager.cc @@ -20,6 +20,7 @@ #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/site_instance.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/common/devtools_messages.h" #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/debugger/devtools_manager.h b/chrome/browser/debugger/devtools_manager.h index 3669c32..89e0498 100644 --- a/chrome/browser/debugger/devtools_manager.h +++ b/chrome/browser/debugger/devtools_manager.h @@ -12,7 +12,6 @@ #include "base/ref_counted.h" #include "chrome/browser/debugger/devtools_client_host.h" #include "chrome/browser/debugger/devtools_toggle_action.h" -#include "chrome/common/devtools_messages.h" #include "webkit/glue/resource_loader_bridge.h" namespace IPC { @@ -28,6 +27,8 @@ class TabContentsWraper; using webkit_glue::ResourceLoaderBridge; +typedef std::map<std::string, std::string> DevToolsRuntimeProperties; + // This class is a singleton that manages DevToolsClientHost instances and // routes messages between developer tools clients and agents. class DevToolsManager : public DevToolsClientHost::CloseListener, diff --git a/chrome/browser/in_process_webkit/indexed_db_callbacks.cc b/chrome/browser/in_process_webkit/indexed_db_callbacks.cc index 41ac4ed..395919d 100644 --- a/chrome/browser/in_process_webkit/indexed_db_callbacks.cc +++ b/chrome/browser/in_process_webkit/indexed_db_callbacks.cc @@ -4,6 +4,8 @@ #include "chrome/browser/in_process_webkit/indexed_db_callbacks.h" +#include "chrome/common/indexed_db_messages.h" + IndexedDBCallbacksBase::IndexedDBCallbacksBase( IndexedDBDispatcherHost* dispatcher_host, int32 response_id) @@ -41,3 +43,31 @@ void IndexedDBTransactionCallbacks::onTimeout() { dispatcher_host_->Send( new IndexedDBMsg_TransactionCallbacksTimeout(transaction_id_)); } + +void IndexedDBCallbacks<WebKit::WebIDBCursor>::onSuccess( + WebKit::WebIDBCursor* idb_object) { + int32 object_id = dispatcher_host()->Add(idb_object); + dispatcher_host()->Send( + new IndexedDBMsg_CallbacksSuccessIDBCursor(response_id(), object_id)); +} + +void IndexedDBCallbacks<WebKit::WebIDBCursor>::onSuccess( + const WebKit::WebSerializedScriptValue& value) { + dispatcher_host()->Send( + new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( + response_id(), SerializedScriptValue(value))); +} + +void IndexedDBCallbacks<WebKit::WebIDBKey>::onSuccess( + const WebKit::WebIDBKey& value) { + dispatcher_host()->Send( + new IndexedDBMsg_CallbacksSuccessIndexedDBKey( + response_id(), IndexedDBKey(value))); +} + +void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess( + const WebKit::WebSerializedScriptValue& value) { + dispatcher_host()->Send( + new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( + response_id(), SerializedScriptValue(value))); +} diff --git a/chrome/browser/in_process_webkit/indexed_db_callbacks.h b/chrome/browser/in_process_webkit/indexed_db_callbacks.h index 3b2b9b4..5ac6592 100644 --- a/chrome/browser/in_process_webkit/indexed_db_callbacks.h +++ b/chrome/browser/in_process_webkit/indexed_db_callbacks.h @@ -9,13 +9,17 @@ #include "base/basictypes.h" #include "base/ref_counted.h" #include "chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h" -#include "chrome/common/indexed_db_messages.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCursor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseError.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransaction.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransactionCallbacks.h" +class IndexedDBMsg_CallbacksSuccessIDBDatabase; +class IndexedDBMsg_CallbacksSuccessIDBIndex; +class IndexedDBMsg_CallbacksSuccessIDBObjectStore; +class IndexedDBMsg_CallbacksSuccessIDBTransaction; + // Template magic to figure out what message to send to the renderer based on // which (overloaded) onSuccess method we expect to be called. template <class Type> struct WebIDBToMsgHelper { }; @@ -85,17 +89,8 @@ class IndexedDBCallbacks<WebKit::WebIDBCursor> IndexedDBDispatcherHost* dispatcher_host, int32 response_id) : IndexedDBCallbacksBase(dispatcher_host, response_id) { } - virtual void onSuccess(WebKit::WebIDBCursor* idb_object) { - int32 object_id = dispatcher_host()->Add(idb_object); - dispatcher_host()->Send( - new IndexedDBMsg_CallbacksSuccessIDBCursor(response_id(), object_id)); - } - - virtual void onSuccess(const WebKit::WebSerializedScriptValue& value) { - dispatcher_host()->Send( - new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( - response_id(), SerializedScriptValue(value))); - } + virtual void onSuccess(WebKit::WebIDBCursor* idb_object); + virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); private: DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); @@ -112,11 +107,7 @@ class IndexedDBCallbacks<WebKit::WebIDBKey> IndexedDBDispatcherHost* dispatcher_host, int32 response_id) : IndexedDBCallbacksBase(dispatcher_host, response_id) { } - virtual void onSuccess(const WebKit::WebIDBKey& value) { - dispatcher_host()->Send( - new IndexedDBMsg_CallbacksSuccessIndexedDBKey( - response_id(), IndexedDBKey(value))); - } + virtual void onSuccess(const WebKit::WebIDBKey& value); private: DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); @@ -133,11 +124,7 @@ class IndexedDBCallbacks<WebKit::WebSerializedScriptValue> IndexedDBDispatcherHost* dispatcher_host, int32 response_id) : IndexedDBCallbacksBase(dispatcher_host, response_id) { } - virtual void onSuccess(const WebKit::WebSerializedScriptValue& value) { - dispatcher_host()->Send( - new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( - response_id(), SerializedScriptValue(value))); - } + virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); private: DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); diff --git a/chrome/browser/notifications/desktop_notifications_unittest.cc b/chrome/browser/notifications/desktop_notifications_unittest.cc index a0193f9..457b135 100644 --- a/chrome/browser/notifications/desktop_notifications_unittest.cc +++ b/chrome/browser/notifications/desktop_notifications_unittest.cc @@ -7,6 +7,7 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/common/pref_names.h" +#include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" #include "chrome/test/testing_pref_service.h" diff --git a/chrome/browser/notifications/desktop_notifications_unittest.h b/chrome/browser/notifications/desktop_notifications_unittest.h index cbd3e4a..4ddee80 100644 --- a/chrome/browser/notifications/desktop_notifications_unittest.h +++ b/chrome/browser/notifications/desktop_notifications_unittest.h @@ -17,7 +17,6 @@ #include "chrome/browser/notifications/notification_test_util.h" #include "chrome/browser/notifications/notification_ui_manager.h" #include "chrome/browser/notifications/notifications_prefs_cache.h" -#include "chrome/common/render_messages.h" #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/renderer/audio_device.cc b/chrome/renderer/audio_device.cc index f69823d..f4ad51a 100644 --- a/chrome/renderer/audio_device.cc +++ b/chrome/renderer/audio_device.cc @@ -5,6 +5,7 @@ #include "chrome/renderer/audio_device.h" #include "base/singleton.h" +#include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" #include "chrome/renderer/render_thread.h" #include "media/audio/audio_util.h" diff --git a/chrome/renderer/audio_device.h b/chrome/renderer/audio_device.h index 292de14..551d3c9 100644 --- a/chrome/renderer/audio_device.h +++ b/chrome/renderer/audio_device.h @@ -12,7 +12,6 @@ #include "base/scoped_ptr.h" #include "base/shared_memory.h" #include "base/threading/simple_thread.h" -#include "chrome/common/render_messages.h" #include "chrome/renderer/audio_message_filter.h" // Each instance of AudioDevice corresponds to one host stream. diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc index e672dca..179a467 100644 --- a/chrome/renderer/autofill/autofill_agent.cc +++ b/chrome/renderer/autofill/autofill_agent.cc @@ -14,6 +14,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "ui/base/keycodes/keyboard_codes.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/renderer/devtools_agent.cc b/chrome/renderer/devtools_agent.cc index dd8e558..5934946 100644 --- a/chrome/renderer/devtools_agent.cc +++ b/chrome/renderer/devtools_agent.cc @@ -8,6 +8,7 @@ #include "base/command_line.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/devtools_messages.h" #include "chrome/common/render_messages.h" #include "chrome/renderer/devtools_agent_filter.h" #include "chrome/renderer/render_view.h" diff --git a/chrome/renderer/devtools_agent.h b/chrome/renderer/devtools_agent.h index 190a499..84507c7 100644 --- a/chrome/renderer/devtools_agent.h +++ b/chrome/renderer/devtools_agent.h @@ -10,7 +10,6 @@ #include <string> #include "base/basictypes.h" -#include "chrome/common/devtools_messages.h" #include "chrome/renderer/render_view_observer.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgentClient.h" @@ -20,6 +19,8 @@ class WebDevToolsAgent; struct DevToolsMessageData; +typedef std::map<std::string, std::string> DevToolsRuntimeProperties; + // DevToolsAgent belongs to the inspectable RenderView and provides Glue's // agents with the communication capabilities. All messages from/to Glue's // agents infrastructure are flowing through this communication agent. diff --git a/chrome/renderer/load_progress_tracker.cc b/chrome/renderer/load_progress_tracker.cc index 0ebba4b..42ce99b 100644 --- a/chrome/renderer/load_progress_tracker.cc +++ b/chrome/renderer/load_progress_tracker.cc @@ -5,6 +5,7 @@ #include "chrome/renderer/load_progress_tracker.h" #include "base/message_loop.h" +#include "chrome/common/render_messages.h" #include "chrome/renderer/render_view.h" namespace { diff --git a/chrome/renderer/media/audio_renderer_impl.cc b/chrome/renderer/media/audio_renderer_impl.cc index 77f82b2..5cd6592 100644 --- a/chrome/renderer/media/audio_renderer_impl.cc +++ b/chrome/renderer/media/audio_renderer_impl.cc @@ -6,6 +6,7 @@ #include <math.h> +#include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" #include "chrome/renderer/audio_message_filter.h" #include "chrome/renderer/render_view.h" diff --git a/chrome/renderer/page_click_tracker.cc b/chrome/renderer/page_click_tracker.cc index 4f463bc..2ba1349 100644 --- a/chrome/renderer/page_click_tracker.cc +++ b/chrome/renderer/page_click_tracker.cc @@ -4,6 +4,7 @@ #include "chrome/renderer/page_click_tracker.h" +#include "chrome/common/render_messages.h" #include "chrome/renderer/page_click_listener.h" #include "chrome/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" diff --git a/chrome/renderer/pepper_devices.cc b/chrome/renderer/pepper_devices.cc index 407d454..bc99b13 100644 --- a/chrome/renderer/pepper_devices.cc +++ b/chrome/renderer/pepper_devices.cc @@ -4,6 +4,7 @@ #include "chrome/renderer/pepper_devices.h" +#include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" #include "chrome/renderer/render_thread.h" #include "chrome/renderer/webplugin_delegate_pepper.h" diff --git a/chrome/renderer/pepper_devices.h b/chrome/renderer/pepper_devices.h index 39f7965..1c0ee41 100644 --- a/chrome/renderer/pepper_devices.h +++ b/chrome/renderer/pepper_devices.h @@ -11,7 +11,6 @@ #include "base/scoped_ptr.h" #include "base/shared_memory.h" #include "base/threading/simple_thread.h" -#include "chrome/common/render_messages.h" #include "chrome/renderer/audio_message_filter.h" #include "third_party/npapi/bindings/npapi.h" #include "third_party/npapi/bindings/npapi_extensions.h" diff --git a/chrome/renderer/pepper_scrollbar_widget.cc b/chrome/renderer/pepper_scrollbar_widget.cc index be5b7df..d81515a 100644 --- a/chrome/renderer/pepper_scrollbar_widget.cc +++ b/chrome/renderer/pepper_scrollbar_widget.cc @@ -10,7 +10,9 @@ #include "chrome/renderer/pepper_devices.h" #include "skia/ext/platform_canvas.h" #include "skia/ext/platform_device.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebScrollbar.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" #include "webkit/plugins/npapi/plugin_instance.h" #include "webkit/glue/webkit_glue.h" diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index cce544f..45ef726 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -25,7 +25,6 @@ #include "chrome/common/edit_command.h" #include "chrome/common/navigation_gesture.h" #include "chrome/common/page_zoom.h" -#include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" #include "chrome/common/renderer_preferences.h" #include "chrome/common/view_types.h" @@ -35,6 +34,7 @@ #include "chrome/renderer/render_widget.h" #include "chrome/renderer/renderer_webcookiejar_impl.h" #include "chrome/renderer/searchbox.h" +#include "ipc/ipc_platform_file.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" @@ -84,6 +84,7 @@ struct PP_Flash_NetAddress; struct ThumbnailScore; struct ViewMsg_ClosePage_Params; struct ViewMsg_Navigate_Params; +struct WebApplicationInfo; struct WebDropData; namespace base { diff --git a/chrome/renderer/renderer_webapplicationcachehost_impl.cc b/chrome/renderer/renderer_webapplicationcachehost_impl.cc index cc50370..0bd18a7 100644 --- a/chrome/renderer/renderer_webapplicationcachehost_impl.cc +++ b/chrome/renderer/renderer_webapplicationcachehost_impl.cc @@ -5,6 +5,7 @@ #include "chrome/renderer/renderer_webapplicationcachehost_impl.h" #include "chrome/common/content_settings_types.h" +#include "chrome/common/render_messages.h" #include "chrome/renderer/render_thread.h" #include "chrome/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" diff --git a/chrome/renderer/safe_browsing/phishing_classifier.cc b/chrome/renderer/safe_browsing/phishing_classifier.cc index a0038b6..668d231 100644 --- a/chrome/renderer/safe_browsing/phishing_classifier.cc +++ b/chrome/renderer/safe_browsing/phishing_classifier.cc @@ -10,6 +10,7 @@ #include "base/compiler_specific.h" #include "base/logging.h" #include "base/sha2.h" +#include "base/string_util.h" #include "chrome/common/url_constants.h" #include "chrome/renderer/render_view.h" #include "chrome/renderer/safe_browsing/feature_extractor_clock.h" diff --git a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc index 74eb406..9a4d5b3 100644 --- a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc +++ b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc @@ -9,6 +9,7 @@ #include "base/logging.h" #include "base/message_loop.h" #include "base/metrics/histogram.h" +#include "base/string_util.h" #include "base/time.h" #include "chrome/renderer/render_view.h" #include "chrome/renderer/safe_browsing/feature_extractor_clock.h" diff --git a/chrome/renderer/translate_helper.cc b/chrome/renderer/translate_helper.cc index 983a651..73033a9 100644 --- a/chrome/renderer/translate_helper.cc +++ b/chrome/renderer/translate_helper.cc @@ -7,6 +7,7 @@ #include "base/compiler_specific.h" #include "base/utf_string_conversions.h" #include "chrome/common/chrome_constants.h" +#include "chrome/common/render_messages.h" #include "chrome/renderer/render_view.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" diff --git a/chrome/renderer/translate_helper_browsertest.cc b/chrome/renderer/translate_helper_browsertest.cc index 3dd1054..067d939 100644 --- a/chrome/renderer/translate_helper_browsertest.cc +++ b/chrome/renderer/translate_helper_browsertest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/common/chrome_constants.h" +#include "chrome/common/render_messages.h" #include "chrome/renderer/translate_helper.h" #include "chrome/test/render_view_test.h" #include "testing/gmock/include/gmock/gmock.h" diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index 01ce8b6..7e78931 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -34,6 +34,7 @@ #include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/navigation_types.h" #include "chrome/common/page_zoom.h" @@ -60,14 +61,15 @@ const DWORD kIEEncodingIdArray[] = { }; ChromeActiveDocument::ChromeActiveDocument() - : first_navigation_(true), + : navigation_info_(new NavigationInfo()), + first_navigation_(true), is_automation_client_reused_(false), popup_allowed_(false), accelerator_table_(NULL) { TRACE_EVENT_BEGIN("chromeframe.createactivedocument", this, ""); url_fetcher_->set_frame_busting(false); - memset(&navigation_info_, 0, sizeof(navigation_info_)); + memset(navigation_info_.get(), 0, sizeof(NavigationInfo)); } HRESULT ChromeActiveDocument::FinalConstruct() { @@ -431,7 +433,7 @@ STDMETHODIMP ChromeActiveDocument::SaveHistory(IStream* stream) { LARGE_INTEGER offset = {0}; ULARGE_INTEGER new_pos = {0}; DWORD written = 0; - std::wstring url = UTF8ToWide(navigation_info_.url.spec()); + std::wstring url = UTF8ToWide(navigation_info_->url.spec()); return stream->Write(url.c_str(), (url.length() + 1) * sizeof(wchar_t), &written); } @@ -439,7 +441,7 @@ STDMETHODIMP ChromeActiveDocument::SaveHistory(IStream* stream) { STDMETHODIMP ChromeActiveDocument::SetPositionCookie(DWORD position_cookie) { if (automation_client_.get()) { int index = static_cast<int>(position_cookie); - navigation_info_.navigation_index = index; + navigation_info_->navigation_index = index; automation_client_->NavigateToIndex(index); } else { DLOG(WARNING) << "Invalid automation client instance"; @@ -451,7 +453,7 @@ STDMETHODIMP ChromeActiveDocument::GetPositionCookie(DWORD* position_cookie) { if (!position_cookie) return E_INVALIDARG; - *position_cookie = navigation_info_.navigation_index; + *position_cookie = navigation_info_->navigation_index; return S_OK; } @@ -710,12 +712,14 @@ void ChromeActiveDocument::OnCloseTab() { void ChromeActiveDocument::UpdateNavigationState( const NavigationInfo& new_navigation_info, int flags) { HRESULT hr = S_OK; - bool is_title_changed = (navigation_info_.title != new_navigation_info.title); + bool is_title_changed = + (navigation_info_->title != new_navigation_info.title); bool is_ssl_state_changed = - (navigation_info_.security_style != new_navigation_info.security_style) || - (navigation_info_.displayed_insecure_content != + (navigation_info_->security_style != + new_navigation_info.security_style) || + (navigation_info_->displayed_insecure_content != new_navigation_info.displayed_insecure_content) || - (navigation_info_.ran_insecure_content != + (navigation_info_->ran_insecure_content != new_navigation_info.ran_insecure_content); if (is_ssl_state_changed) { @@ -834,7 +838,7 @@ void ChromeActiveDocument::UpdateNavigationState( // finalized the travel log. This is because IE will ask for information // such as navigation index when the travel log is finalized and we need // supply the old index and not the new one. - navigation_info_ = new_navigation_info; + *navigation_info_ = new_navigation_info; // Update the IE zone here. Ideally we would like to do it when the active // document is activated. However that does not work at times as the frame we // get there is not the actual frame which handles the command. @@ -852,9 +856,9 @@ void ChromeActiveDocument::OnFindInPage() { } void ChromeActiveDocument::OnViewSource() { - DCHECK(navigation_info_.url.is_valid()); + DCHECK(navigation_info_->url.is_valid()); HostNavigate(GURL(chrome::kViewSourceScheme + std::string(":") + - navigation_info_.url.spec()), GURL(), NEW_WINDOW); + navigation_info_->url.spec()), GURL(), NEW_WINDOW); } void ChromeActiveDocument::OnDetermineSecurityZone(const GUID* cmd_group_guid, @@ -1125,10 +1129,10 @@ HRESULT ChromeActiveDocument::OnRefreshPage(const GUID* cmd_group_guid, ResetUrlRequestManager(); url_fetcher_->set_frame_busting(false); // And now launch the current URL again. This starts a new server process. - DCHECK(navigation_info_.url.is_valid()); + DCHECK(navigation_info_->url.is_valid()); ChromeFrameUrl cf_url; - cf_url.Parse(UTF8ToWide(navigation_info_.url.spec())); - LaunchUrl(cf_url, navigation_info_.referrer.spec()); + cf_url.Parse(UTF8ToWide(navigation_info_->url.spec())); + LaunchUrl(cf_url, navigation_info_->referrer.spec()); } return S_OK; @@ -1383,16 +1387,16 @@ bool ChromeActiveDocument::IsNewNavigation( return false; if (new_navigation_info.navigation_index == - navigation_info_.navigation_index) + navigation_info_->navigation_index) return false; - if (new_navigation_info.navigation_type != navigation_info_.navigation_type) + if (new_navigation_info.navigation_type != navigation_info_->navigation_type) return true; - if (new_navigation_info.url != navigation_info_.url) + if (new_navigation_info.url != navigation_info_->url) return true; - if (new_navigation_info.referrer != navigation_info_.referrer) + if (new_navigation_info.referrer != navigation_info_->referrer) return true; return false; diff --git a/chrome_frame/chrome_active_document.h b/chrome_frame/chrome_active_document.h index 84a6f88..e771bad 100644 --- a/chrome_frame/chrome_active_document.h +++ b/chrome_frame/chrome_active_document.h @@ -448,7 +448,7 @@ END_EXEC_COMMAND_MAP() protected: typedef std::map<int, OLECMDF> CommandStatusMap; - NavigationInfo navigation_info_; + scoped_ptr<NavigationInfo> navigation_info_; bool is_doc_object_; // This indicates whether this is the first navigation in this diff --git a/chrome_frame/chrome_frame.gyp b/chrome_frame/chrome_frame.gyp index 4d4f6a6..d7eb4ec 100644 --- a/chrome_frame/chrome_frame.gyp +++ b/chrome_frame/chrome_frame.gyp @@ -921,6 +921,7 @@ 'chrome_frame_automation.cc', 'chrome_frame_delegate.h', 'chrome_frame_delegate.cc', + 'chrome_frame_plugin.cc', 'chrome_frame_plugin.h', 'chrome_launcher_utils.cc', 'chrome_launcher_utils.h', diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc index c7dcb40..d0add36 100644 --- a/chrome_frame/chrome_frame_activex.cc +++ b/chrome_frame/chrome_frame_activex.cc @@ -23,6 +23,7 @@ #include "base/utf_string_conversions.h" #include "base/win/scoped_bstr.h" #include "base/win/scoped_variant.h" +#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/automation/tab_proxy.h" @@ -115,6 +116,36 @@ HHOOK InstallLocalWindowHook(HWND window) { } // unnamed namespace +namespace chrome_frame { +std::string ActiveXCreateUrl(const GURL& parsed_url, + const AttachExternalTabParams& params) { + return base::StringPrintf( + "%hs?attach_external_tab&%I64u&%d&%d&%d&%d&%d&%hs", + parsed_url.GetOrigin().spec().c_str(), + params.cookie, + params.disposition, + params.dimensions.x(), + params.dimensions.y(), + params.dimensions.width(), + params.dimensions.height(), + params.profile_name.c_str()); +} + +int GetDisposition(const AttachExternalTabParams& params) { + return params.disposition; +} + +void GetMiniContextMenuData(UINT cmd, + const MiniContextMenuParams& params, + GURL* referrer, + GURL* url) { + *referrer = params.frame_url.is_empty() ? params.page_url : params.frame_url; + *url = (cmd == IDS_CONTENT_CONTEXT_SAVELINKAS ? + params.link_url : params.src_url); +} + +} // namespace chrome_frame + ChromeFrameActivex::ChromeFrameActivex() : chrome_wndproc_hook_(NULL) { TRACE_EVENT_BEGIN("chromeframe.createactivex", this, ""); diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index 8ef28b5..598c5d4 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -148,6 +148,18 @@ class ATL_NO_VTABLE ProxyDIChromeFrameEvents extern bool g_first_launch_by_process_; +namespace chrome_frame { +// Implemented outside this file so that the header doesn't include +// automation_messages.h. +std::string ActiveXCreateUrl(const GURL& parsed_url, + const AttachExternalTabParams& params); +int GetDisposition(const AttachExternalTabParams& params); +void GetMiniContextMenuData(UINT cmd, + const MiniContextMenuParams& params, + GURL* referrer, + GURL* url); +} // namespace chrome_frame + // Common implementation for ActiveX and Active Document template <class T, const CLSID& class_id> class ATL_NO_VTABLE ChromeFrameActivexBase : // NOLINT @@ -357,10 +369,8 @@ END_MSG_MAP() case IDS_CONTENT_CONTEXT_SAVEVIDEOAS: case IDS_CONTENT_CONTEXT_SAVEIMAGEAS: case IDS_CONTENT_CONTEXT_SAVELINKAS: { - const GURL& referrer = params.frame_url.is_empty() ? - params.page_url : params.frame_url; - const GURL& url = (cmd == IDS_CONTENT_CONTEXT_SAVELINKAS ? - params.link_url : params.src_url); + GURL referrer, url; + chrome_frame::GetMiniContextMenuData(cmd, params, &referrer, &url); DoFileDownloadInIE(UTF8ToWide(url.spec()).c_str()); return true; } @@ -492,17 +502,8 @@ END_MSG_MAP() parsed_url = parsed_url.ReplaceComponents(r); } - std::string url = base::StringPrintf( - "%hs?attach_external_tab&%I64u&%d&%d&%d&%d&%d&%hs", - parsed_url.GetOrigin().spec().c_str(), - params.cookie, - params.disposition, - params.dimensions.x(), - params.dimensions.y(), - params.dimensions.width(), - params.dimensions.height(), - params.profile_name.c_str()); - HostNavigate(GURL(url), GURL(), params.disposition); + std::string url = chrome_frame::ActiveXCreateUrl(parsed_url, params); + HostNavigate(GURL(url), GURL(), chrome_frame::GetDisposition(params)); } virtual void OnHandleContextMenu(HANDLE menu_handle, diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index f453c2e..81eecee 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -21,6 +21,7 @@ #include "base/sys_info.h" #include "base/utf_string_conversions.h" #include "chrome/app/client_util.h" +#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/automation/tab_proxy.h" diff --git a/chrome_frame/chrome_frame_delegate.cc b/chrome_frame/chrome_frame_delegate.cc index a2e84b6..28e631f 100644 --- a/chrome_frame/chrome_frame_delegate.cc +++ b/chrome_frame/chrome_frame_delegate.cc @@ -4,6 +4,8 @@ #include "chrome_frame/chrome_frame_delegate.h" +#include "chrome/common/automation_messages.h" + bool ChromeFrameDelegateImpl::IsTabMessage(const IPC::Message& message) { bool is_tab_message = true; IPC_BEGIN_MESSAGE_MAP(ChromeFrameDelegateImpl, message) diff --git a/chrome_frame/chrome_frame_delegate.h b/chrome_frame/chrome_frame_delegate.h index f6c1f4c..a43d451 100644 --- a/chrome_frame/chrome_frame_delegate.h +++ b/chrome_frame/chrome_frame_delegate.h @@ -14,9 +14,20 @@ #include "base/file_path.h" #include "base/synchronization/lock.h" -#include "chrome/common/automation_messages.h" +#include "base/task.h" +#include "chrome/common/automation_constants.h" #include "ipc/ipc_message.h" +class GURL; +struct AttachExternalTabParams; +struct AutomationURLRequest; +struct MiniContextMenuParams; +struct NavigationInfo; + +namespace net { +class URLRequestStatus; +} + // A common interface supported by all the browser specific ChromeFrame // implementations. class ChromeFrameDelegate { diff --git a/chrome_frame/chrome_frame_plugin.cc b/chrome_frame/chrome_frame_plugin.cc new file mode 100644 index 0000000..f665e51 --- /dev/null +++ b/chrome_frame/chrome_frame_plugin.cc @@ -0,0 +1,14 @@ +// 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. + +#include "chrome_frame/chrome_frame_plugin.h" + +#include "chrome/common/automation_messages.h" + +void ChromeFramePluginGetParamsCoordinates(const MiniContextMenuParams& params, + int* x, + int* y) { + *x = params.screen_x; + *y = params.screen_y; +} diff --git a/chrome_frame/chrome_frame_plugin.h b/chrome_frame/chrome_frame_plugin.h index 9513087..2d0c43e 100644 --- a/chrome_frame/chrome_frame_plugin.h +++ b/chrome_frame/chrome_frame_plugin.h @@ -20,6 +20,12 @@ #define IDC_ABOUT_CHROME_FRAME 40018 +// Helper so that this file doesn't include the messages header. +void ChromeFramePluginGetParamsCoordinates( + const MiniContextMenuParams& params, + int* x, + int* y); + // A class to implement common functionality for all types of // plugins: NPAPI. ActiveX and ActiveDoc template <typename T> @@ -141,8 +147,9 @@ END_MSG_MAP() SetFocus(GetWindow()); ignore_setfocus_ = false; UINT flags = align_flags | TPM_LEFTBUTTON | TPM_RETURNCMD | TPM_RECURSE; - UINT selected = TrackPopupMenuEx(copy, flags, params.screen_x, - params.screen_y, GetWindow(), NULL); + int x, y; + ChromeFramePluginGetParamsCoordinates(params, &x, &y); + UINT selected = TrackPopupMenuEx(copy, flags, x, y, GetWindow(), NULL); // Menu is over now give focus back to chrome GiveFocusToChrome(false); if (IsValid() && selected != 0 && diff --git a/chrome_frame/npapi_url_request.cc b/chrome_frame/npapi_url_request.cc index 49b3555..8771ca2 100644 --- a/chrome_frame/npapi_url_request.cc +++ b/chrome_frame/npapi_url_request.cc @@ -6,6 +6,7 @@ #include "base/string_number_conversions.h" #include "base/threading/platform_thread.h" +#include "chrome/common/automation_messages.h" #include "chrome_frame/chrome_frame_npapi.h" #include "chrome_frame/np_browser_functions.h" #include "chrome_frame/np_utils.h" diff --git a/chrome_frame/protocol_sink_wrap.cc b/chrome_frame/protocol_sink_wrap.cc index 7dfe6c2..5d5658f 100644 --- a/chrome_frame/protocol_sink_wrap.cc +++ b/chrome_frame/protocol_sink_wrap.cc @@ -9,6 +9,7 @@ #include "base/logging.h" #include "base/singleton.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/stringprintf.h" #include "base/utf_string_conversions.h" diff --git a/chrome_frame/test/automation_client_mock.cc b/chrome_frame/test/automation_client_mock.cc index c3f93d5..9ff5b61 100644 --- a/chrome_frame/test/automation_client_mock.cc +++ b/chrome_frame/test/automation_client_mock.cc @@ -5,6 +5,7 @@ #include "chrome_frame/test/automation_client_mock.h" #include "base/callback.h" +#include "chrome/common/automation_messages.h" #include "chrome_frame/custom_sync_call_context.h" #include "chrome_frame/navigation_constraints.h" #include "chrome_frame/test/chrome_frame_test_utils.h" diff --git a/chrome_frame/test/url_request_test.cc b/chrome_frame/test/url_request_test.cc index e6db001..a7edb8c 100644 --- a/chrome_frame/test/url_request_test.cc +++ b/chrome_frame/test/url_request_test.cc @@ -6,6 +6,7 @@ #include <atlcom.h> #include "app/win/scoped_com_initializer.h" +#include "chrome/common/automation_messages.h" #include "chrome_frame/test/chrome_frame_test_utils.h" #include "chrome_frame/test/test_server.h" #include "chrome_frame/test/test_with_web_server.h" diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index 1a71f65..c5c9bd5 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -21,6 +21,7 @@ #include "chrome_frame/urlmon_url_request_private.h" #include "chrome_frame/urlmon_upload_data_stream.h" #include "chrome_frame/utils.h" +#include "chrome/common/automation_messages.h" #include "net/base/load_flags.h" #include "net/http/http_response_headers.h" #include "net/http/http_util.h" |