summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-21 17:35:08 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-21 17:35:08 +0000
commit3b3ec721627391f78747d19bd3cc87792e0210a8 (patch)
tree63db7ee2728988eaf7f445417276daa22aab23f9 /chrome_frame
parent78e7603d28966adf4d1305e00cdc27ef07ebcc3b (diff)
downloadchromium_src-3b3ec721627391f78747d19bd3cc87792e0210a8.zip
chromium_src-3b3ec721627391f78747d19bd3cc87792e0210a8.tar.gz
chromium_src-3b3ec721627391f78747d19bd3cc87792e0210a8.tar.bz2
Update automation messages to use the new way of declaring message structs, to cut back on unnecessary code.
Review URL: http://codereview.chromium.org/8356020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106734 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/cfproxy_proxy.cc1
-rw-r--r--chrome_frame/chrome_frame_automation.cc42
-rw-r--r--chrome_frame/test/url_request_test.cc16
3 files changed, 31 insertions, 28 deletions
diff --git a/chrome_frame/cfproxy_proxy.cc b/chrome_frame/cfproxy_proxy.cc
index 680588e..d8fd2ab 100644
--- a/chrome_frame/cfproxy_proxy.cc
+++ b/chrome_frame/cfproxy_proxy.cc
@@ -129,7 +129,6 @@ void CFProxy::Tab_Find(int tab, const string16& search_string,
FindInPageDirection forward, FindInPageCase match_case,
bool find_next) {
AutomationMsg_Find_Params params;
- params.unused = 0;
params.search_string = search_string;
params.find_next = find_next;
params.match_case = (match_case == CASE_SENSITIVE);
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index 2415932..61f6ce1 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -767,7 +767,6 @@ void ChromeFrameAutomationClient::FindInPage(const std::wstring& search_string,
// the SyncMessageReplyDispatcher to avoid concerns about blocking
// synchronous messages.
AutomationMsg_Find_Params params;
- params.unused = 0;
params.search_string = WideToUTF16Hack(search_string);
params.find_next = find_next;
params.match_case = (match_case == CASE_SENSITIVE);
@@ -798,18 +797,18 @@ void ChromeFrameAutomationClient::CreateExternalTab() {
navigate_after_initialization_ = false;
}
- const ExternalTabSettings settings(
- m_hWnd,
- gfx::Rect(),
- WS_CHILD,
- chrome_launch_params_->incognito(),
- !use_chrome_network_,
- handle_top_level_requests_,
- chrome_launch_params_->url(),
- chrome_launch_params_->referrer(),
- // Infobars disabled in widget mode.
- !chrome_launch_params_->widget_mode(),
- chrome_launch_params_->route_all_top_level_navigations());
+ ExternalTabSettings settings;
+ settings.parent = m_hWnd;
+ settings.style = WS_CHILD;
+ settings.is_incognito = chrome_launch_params_->incognito();
+ settings.load_requests_via_automation = !use_chrome_network_;
+ settings.handle_top_level_requests = handle_top_level_requests_;
+ settings.initial_url = chrome_launch_params_->url();
+ settings.referrer = chrome_launch_params_->referrer();
+ // Infobars disabled in widget mode.
+ settings.infobars_enabled = !chrome_launch_params_->widget_mode();
+ settings.route_all_top_level_navigations =
+ chrome_launch_params_->route_all_top_level_navigations();
UMA_HISTOGRAM_CUSTOM_COUNTS(
"ChromeFrame.HostNetworking", !use_chrome_network_, 0, 1, 2);
@@ -1242,14 +1241,15 @@ void ChromeFrameAutomationClient::OnResponseStarted(int request_id,
const char* mime_type, const char* headers, int size,
base::Time last_modified, const std::string& redirect_url,
int redirect_status, const net::HostPortPair& socket_address) {
- const AutomationURLResponse response(
- mime_type,
- headers ? headers : "",
- size,
- last_modified,
- redirect_url,
- redirect_status,
- socket_address);
+ AutomationURLResponse response;
+ response.mime_type = mime_type;
+ if (headers)
+ response.headers = headers;
+ response.content_length = size;
+ response.last_modified = last_modified;
+ response.redirect_url = redirect_url;
+ response.redirect_status = redirect_status;
+ response.socket_address = socket_address;
automation_server_->Send(new AutomationMsg_RequestStarted(
tab_->handle(), request_id, response));
diff --git a/chrome_frame/test/url_request_test.cc b/chrome_frame/test/url_request_test.cc
index 86093b6..f91fb9e 100644
--- a/chrome_frame/test/url_request_test.cc
+++ b/chrome_frame/test/url_request_test.cc
@@ -264,9 +264,11 @@ TEST(UrlmonUrlRequestManagerTest, Simple1) {
scoped_ptr<UrlmonUrlRequestManager> mgr(new UrlmonUrlRequestManager());
mgr->set_delegate(&mock);
- AutomationURLRequest r1(
- WideToUTF8(mock_server.Resolve(L"chrome_frame_window_open.html")),
- "get", "", "", NULL, 0, 0);
+ AutomationURLRequest r1;
+ r1.url = WideToUTF8(mock_server.Resolve(L"chrome_frame_window_open.html"));
+ r1.method = "get";
+ r1.resource_type = 0;
+ r1.load_flags = 0;
EXPECT_CALL(mock, OnResponseStarted(1, testing::_, testing::_, testing::_,
testing::_, testing::_, testing::_, testing::_))
@@ -297,9 +299,11 @@ TEST(UrlmonUrlRequestManagerTest, Abort1) {
scoped_ptr<UrlmonUrlRequestManager> mgr(new UrlmonUrlRequestManager());
mgr->set_delegate(&mock);
- AutomationURLRequest r1(
- WideToUTF8(mock_server.Resolve(L"chrome_frame_window_open.html")),
- "get", "", "", NULL, 0, 0);
+ AutomationURLRequest r1;
+ r1.url = WideToUTF8(mock_server.Resolve(L"chrome_frame_window_open.html"));
+ r1.method = "get";
+ r1.resource_type = 0;
+ r1.load_flags = 0;
EXPECT_CALL(mock, OnResponseStarted(1, testing::_, testing::_, testing::_,
testing::_, testing::_, testing::_, testing::_))