summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_active_document.cc
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/chrome_active_document.cc
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/chrome_active_document.cc')
-rw-r--r--chrome_frame/chrome_active_document.cc42
1 files changed, 23 insertions, 19 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;