summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-09 07:15:35 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-09 07:15:35 +0000
commita22f7e069020486f1d93510b46b488b40dcb57c7 (patch)
tree65c408219af0405df7914877a944cc2c58540cc1 /chrome_frame
parent91c521b79fcd8a696f5a08013269cb1fd2b7c394 (diff)
downloadchromium_src-a22f7e069020486f1d93510b46b488b40dcb57c7.zip
chromium_src-a22f7e069020486f1d93510b46b488b40dcb57c7.tar.gz
chromium_src-a22f7e069020486f1d93510b46b488b40dcb57c7.tar.bz2
Remove includes of message headers in headers.
Review URL: http://codereview.chromium.org/6458004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74257 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_active_document.cc42
-rw-r--r--chrome_frame/chrome_active_document.h2
-rw-r--r--chrome_frame/chrome_frame.gyp1
-rw-r--r--chrome_frame/chrome_frame_activex.cc31
-rw-r--r--chrome_frame/chrome_frame_activex_base.h31
-rw-r--r--chrome_frame/chrome_frame_automation.cc1
-rw-r--r--chrome_frame/chrome_frame_delegate.cc2
-rw-r--r--chrome_frame/chrome_frame_delegate.h13
-rw-r--r--chrome_frame/chrome_frame_plugin.cc14
-rw-r--r--chrome_frame/chrome_frame_plugin.h11
-rw-r--r--chrome_frame/npapi_url_request.cc1
-rw-r--r--chrome_frame/protocol_sink_wrap.cc1
-rw-r--r--chrome_frame/test/automation_client_mock.cc1
-rw-r--r--chrome_frame/test/url_request_test.cc1
-rw-r--r--chrome_frame/urlmon_url_request.cc1
15 files changed, 115 insertions, 38 deletions
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"