diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-01 19:24:33 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-01 19:24:33 +0000 |
commit | ea1c18e1bf3bbe6d9bb7bb8769142e5f0429293a (patch) | |
tree | 1c0a736b831d15b4e250c41c471791368ecbef6a | |
parent | 8898ec205da3a100d12ff5ddb64eab993de3cf67 (diff) | |
download | chromium_src-ea1c18e1bf3bbe6d9bb7bb8769142e5f0429293a.zip chromium_src-ea1c18e1bf3bbe6d9bb7bb8769142e5f0429293a.tar.gz chromium_src-ea1c18e1bf3bbe6d9bb7bb8769142e5f0429293a.tar.bz2 |
Revert "Refactor automation messages." due to mysterious problems on mac.
This reverts commit c1c1fed998ee4d839bfe256150e5e59220ebc0ef (r64637).
TBR=nirnimesh@
BUG=51409
TEST=none
Review URL: http://codereview.chromium.org/4194007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64644 0039d316-1c4b-4281-b951-d872f2087c98
71 files changed, 200 insertions, 190 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 502b495..60ed6ef 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -85,7 +85,6 @@ #include "chrome/browser/tab_contents/tab_contents_view.h" #include "chrome/browser/translate/translate_infobar_delegate.h" #include "chrome/common/automation_constants.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" @@ -96,6 +95,7 @@ #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/tab_proxy.h" #include "net/proxy/proxy_service.h" #include "net/proxy/proxy_config_service_fixed.h" diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 8e23454..66d084a 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -23,9 +23,9 @@ #include "chrome/browser/autofill/field_types.h" #include "chrome/browser/cancelable_request.h" #include "chrome/browser/tab_contents/navigation_entry.h" -#include "chrome/common/automation_constants.h" #include "chrome/common/content_settings.h" #include "chrome/common/notification_observer.h" +#include "chrome/test/automation/automation_constants.h" #include "ipc/ipc_message.h" #include "ipc/ipc_channel.h" #if defined(OS_WIN) diff --git a/chrome/browser/automation/automation_provider_gtk.cc b/chrome/browser/automation/automation_provider_gtk.cc index bf6a15c..37c4fb8 100644 --- a/chrome/browser/automation/automation_provider_gtk.cc +++ b/chrome/browser/automation/automation_provider_gtk.cc @@ -13,7 +13,7 @@ #include "chrome/browser/gtk/browser_window_gtk.h" #include "chrome/browser/gtk/gtk_util.h" #include "chrome/browser/gtk/view_id_util.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "gfx/point.h" #include "gfx/rect.h" diff --git a/chrome/browser/automation/automation_provider_json.cc b/chrome/browser/automation/automation_provider_json.cc index 16fd8d4..c58b622 100644 --- a/chrome/browser/automation/automation_provider_json.cc +++ b/chrome/browser/automation/automation_provider_json.cc @@ -8,7 +8,7 @@ #include "base/json/string_escape.h" #include "chrome/browser/autocomplete/autocomplete_match.h" #include "chrome/browser/automation/automation_provider.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" namespace { diff --git a/chrome/browser/automation/automation_provider_mac.mm b/chrome/browser/automation/automation_provider_mac.mm index 451e7f1..99c1bdb 100644 --- a/chrome/browser/automation/automation_provider_mac.mm +++ b/chrome/browser/automation/automation_provider_mac.mm @@ -14,7 +14,7 @@ #include "chrome/browser/cocoa/tab_window_controller.h" #include "chrome/browser/view_ids.h" #import "chrome/browser/cocoa/browser_window_controller.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "gfx/point.h" #include "gfx/rect.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index 174cc42..7cfa96f 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -35,9 +35,9 @@ #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/translate/page_translated_details.h" #include "chrome/browser/translate/translate_infobar_delegate.h" -#include "chrome/common/automation_constants.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/notification_service.h" +#include "chrome/test/automation/automation_constants.h" #include "gfx/rect.h" #if defined(OS_CHROMEOS) diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h index 708d0c4..7b76638 100644 --- a/chrome/browser/automation/automation_provider_observers.h +++ b/chrome/browser/automation/automation_provider_observers.h @@ -21,10 +21,10 @@ #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/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/notification_type.h" +#include "chrome/test/automation/automation_messages.h" class AutocompleteEditModel; class AutomationProvider; diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index 8c12135..7843c83 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -22,8 +22,8 @@ #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/views/bookmark_bar_view.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/page_zoom.h" +#include "chrome/test/automation/automation_messages.h" #include "views/focus/accelerator_handler.h" #include "views/widget/root_view.h" #include "views/widget/widget_win.h" diff --git a/chrome/browser/automation/automation_resource_message_filter.cc b/chrome/browser/automation/automation_resource_message_filter.cc index 98461d7..ecbbddc 100644 --- a/chrome/browser/automation/automation_resource_message_filter.cc +++ b/chrome/browser/automation/automation_resource_message_filter.cc @@ -15,8 +15,8 @@ #include "chrome/browser/net/url_request_slow_download_job.h" #include "chrome/browser/net/url_request_slow_http_job.h" #include "chrome/browser/renderer_host/resource_message_filter.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_paths.h" +#include "chrome/test/automation/automation_messages.h" #include "googleurl/src/gurl.h" #include "net/base/net_errors.h" #include "net/url_request/url_request_filter.h" diff --git a/chrome/browser/automation/automation_resource_tracker.cc b/chrome/browser/automation/automation_resource_tracker.cc index 49797c6e..a82265d 100644 --- a/chrome/browser/automation/automation_resource_tracker.cc +++ b/chrome/browser/automation/automation_resource_tracker.cc @@ -4,8 +4,8 @@ #include "chrome/browser/automation/automation_resource_tracker.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/notification_service.h" +#include "chrome/test/automation/automation_messages.h" AutomationResourceTrackerImpl::AutomationResourceTrackerImpl( IPC::Message::Sender* sender) diff --git a/chrome/browser/automation/chrome_frame_automation_provider.cc b/chrome/browser/automation/chrome_frame_automation_provider.cc index 4de788a..b3ea659 100644 --- a/chrome/browser/automation/chrome_frame_automation_provider.cc +++ b/chrome/browser/automation/chrome_frame_automation_provider.cc @@ -5,7 +5,7 @@ #include "chrome/browser/automation/chrome_frame_automation_provider.h" #include "chrome/browser/profile.h" #include "chrome/browser/profile_manager.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "ipc/ipc_message.h" #include "ipc/ipc_channel.h" diff --git a/chrome/browser/automation/extension_port_container.cc b/chrome/browser/automation/extension_port_container.cc index 5c030c4..f6b502e 100644 --- a/chrome/browser/automation/extension_port_container.cc +++ b/chrome/browser/automation/extension_port_container.cc @@ -15,9 +15,9 @@ #include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/render_view_host.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/notification_service.h" #include "chrome/common/render_messages.h" +#include "chrome/test/automation/automation_messages.h" // TODO(siggi): Find a more structured way to read and write JSON messages. diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 6d22ba4..241a4b1 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -65,7 +65,7 @@ #include "chrome/browser/notifications/balloon_collection.h" #include "chrome/browser/notifications/notification.h" #include "chrome/browser/notifications/notification_ui_manager.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "net/base/cookie_store.h" #include "net/url_request/url_request_context.h" #include "views/event.h" @@ -1352,7 +1352,7 @@ void TestingAutomationProvider::GetSecurityState(int handle, void TestingAutomationProvider::GetPageType( int handle, bool* success, - PageType* page_type) { + NavigationEntry::PageType* page_type) { if (tab_tracker_->ContainsHandle(handle)) { NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); @@ -1360,12 +1360,12 @@ void TestingAutomationProvider::GetPageType( *success = true; // In order to return the proper result when an interstitial is shown and // no navigation entry were created for it we need to ask the TabContents. - if (*page_type == NORMAL_PAGE && + if (*page_type == NavigationEntry::NORMAL_PAGE && tab->tab_contents()->showing_interstitial_page()) - *page_type = INTERSTITIAL_PAGE; + *page_type = NavigationEntry::INTERSTITIAL_PAGE; } else { *success = false; - *page_type = NORMAL_PAGE; + *page_type = NavigationEntry::NORMAL_PAGE; } } @@ -1383,7 +1383,7 @@ void TestingAutomationProvider::ActionOnSSLBlockingPage( if (tab_tracker_->ContainsHandle(handle)) { NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); - if (entry->page_type() == INTERSTITIAL_PAGE) { + if (entry->page_type() == NavigationEntry::INTERSTITIAL_PAGE) { TabContents* tab_contents = tab->tab_contents(); InterstitialPage* ssl_blocking_page = InterstitialPage::GetInterstitialPage(tab_contents); @@ -2458,10 +2458,10 @@ void TestingAutomationProvider::GetNavigationInfo( return_value->Set("ssl", ssl); // Page type. - std::map<PageType, std::string> pagetype_to_string; - pagetype_to_string[NORMAL_PAGE] = "NORMAL_PAGE"; - pagetype_to_string[ERROR_PAGE] = "ERROR_PAGE"; - pagetype_to_string[INTERSTITIAL_PAGE] = "INTERSTITIAL_PAGE"; + std::map<NavigationEntry::PageType, std::string> pagetype_to_string; + pagetype_to_string[NavigationEntry::NORMAL_PAGE] = "NORMAL_PAGE"; + pagetype_to_string[NavigationEntry::ERROR_PAGE] = "ERROR_PAGE"; + pagetype_to_string[NavigationEntry::INTERSTITIAL_PAGE] = "INTERSTITIAL_PAGE"; return_value->SetString("page_type", pagetype_to_string[nav_entry->page_type()]); diff --git a/chrome/browser/automation/testing_automation_provider.h b/chrome/browser/automation/testing_automation_provider.h index 309db74..dc76603 100644 --- a/chrome/browser/automation/testing_automation_provider.h +++ b/chrome/browser/automation/testing_automation_provider.h @@ -11,7 +11,6 @@ #include "chrome/browser/browser_list.h" #include "chrome/browser/history/history.h" #include "chrome/common/notification_registrar.h" -#include "chrome/common/page_type.h" class DictionaryValue; class TemplateURLModel; @@ -198,7 +197,8 @@ class TestingAutomationProvider : public AutomationProvider, int* insecure_content_status); // Gets the page type for the tab associated to the specified |handle|. - void GetPageType(int handle, bool* success, PageType* page_type); + void GetPageType(int handle, bool* success, + NavigationEntry::PageType* page_type); // Gets the duration in ms of the last event matching |event_name|. // |duration_ms| is -1 if the event hasn't occurred yet. diff --git a/chrome/browser/automation/testing_automation_provider_views.cc b/chrome/browser/automation/testing_automation_provider_views.cc index f8631cf..6048cd8 100644 --- a/chrome/browser/automation/testing_automation_provider_views.cc +++ b/chrome/browser/automation/testing_automation_provider_views.cc @@ -9,7 +9,7 @@ #include "chrome/browser/browser_window.h" #include "chrome/browser/views/frame/browser_view.h" #include "chrome/browser/views/toolbar_view.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "gfx/point.h" #include "views/controls/menu/menu_wrapper.h" #include "views/view.h" diff --git a/chrome/browser/automation/ui_controls_linux.cc b/chrome/browser/automation/ui_controls_linux.cc index 21cd0dd..a2dd0ae 100644 --- a/chrome/browser/automation/ui_controls_linux.cc +++ b/chrome/browser/automation/ui_controls_linux.cc @@ -13,7 +13,7 @@ #include "base/message_loop.h" #include "chrome/browser/automation/ui_controls_internal.h" #include "chrome/browser/gtk/gtk_util.h" -#include "chrome/common/automation_constants.h" +#include "chrome/test/automation/automation_constants.h" #if defined(TOOLKIT_VIEWS) #include "views/view.h" diff --git a/chrome/browser/automation/url_request_automation_job.cc b/chrome/browser/automation/url_request_automation_job.cc index 1b73b68..fc4bd63 100644 --- a/chrome/browser/automation/url_request_automation_job.cc +++ b/chrome/browser/automation/url_request_automation_job.cc @@ -11,7 +11,7 @@ #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "net/base/cookie_monster.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" diff --git a/chrome/browser/extensions/extension_uitest.cc b/chrome/browser/extensions/extension_uitest.cc index 8688806..f074c9b 100644 --- a/chrome/browser/extensions/extension_uitest.cc +++ b/chrome/browser/extensions/extension_uitest.cc @@ -8,9 +8,9 @@ #include "base/values.h" #include "chrome/browser/automation/extension_automation_constants.h" #include "chrome/browser/extensions/extension_tabs_module_constants.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy_uitest.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index 4707d88..6496971 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -30,7 +30,6 @@ #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/views/page_info_bubble_view.h" #include "chrome/browser/views/tab_contents/tab_contents_container.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/bindings_policy.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/render_messages.h" @@ -38,6 +37,7 @@ #include "chrome/common/native_web_keyboard_event.h" #include "chrome/common/notification_service.h" #include "chrome/common/page_transition_types.h" +#include "chrome/test/automation/automation_messages.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "views/grid_layout.h" @@ -618,7 +618,7 @@ bool ExternalTabContainer::HandleContextMenu(const ContextMenuParams& params) { POINT screen_pt = { params.x, params.y }; MapWindowPoints(GetNativeView(), HWND_DESKTOP, &screen_pt, 1); - IPC::MiniContextMenuParams ipc_params; + IPC::ContextMenuParams ipc_params; ipc_params.screen_x = screen_pt.x; ipc_params.screen_y = screen_pt.y; ipc_params.link_url = params.link_url; diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index 2e35b58..247ae91 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -38,7 +38,7 @@ class SSLUITest : public InProcessBrowserTest { bool displayed_insecure_content) { NavigationEntry* entry = tab->controller().GetActiveEntry(); ASSERT_TRUE(entry); - EXPECT_EQ(NORMAL_PAGE, entry->page_type()); + EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry->page_type()); EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, entry->ssl().security_style()); EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); EXPECT_EQ(displayed_insecure_content, @@ -49,7 +49,7 @@ class SSLUITest : public InProcessBrowserTest { void CheckUnauthenticatedState(TabContents* tab) { NavigationEntry* entry = tab->controller().GetActiveEntry(); ASSERT_TRUE(entry); - EXPECT_EQ(NORMAL_PAGE, entry->page_type()); + EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry->page_type()); EXPECT_EQ(SECURITY_STYLE_UNAUTHENTICATED, entry->ssl().security_style()); EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); EXPECT_FALSE(entry->ssl().displayed_insecure_content()); @@ -62,7 +62,8 @@ class SSLUITest : public InProcessBrowserTest { bool interstitial) { NavigationEntry* entry = tab->controller().GetActiveEntry(); ASSERT_TRUE(entry); - EXPECT_EQ(interstitial ? INTERSTITIAL_PAGE : NORMAL_PAGE, + EXPECT_EQ(interstitial ? NavigationEntry::INTERSTITIAL_PAGE : + NavigationEntry::NORMAL_PAGE, entry->page_type()); EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, entry->ssl().security_style()); diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index 8705e62..ae1e078 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -223,7 +223,7 @@ void InterstitialPage::Show() { NavigationEntry* entry = new NavigationEntry; entry->set_url(url_); entry->set_virtual_url(url_); - entry->set_page_type(INTERSTITIAL_PAGE); + entry->set_page_type(NavigationEntry::INTERSTITIAL_PAGE); // Give sub-classes a chance to set some states on the navigation entry. UpdateEntry(entry); diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc index 918a9b4..fc753c3 100644 --- a/chrome/browser/tab_contents/navigation_controller.cc +++ b/chrome/browser/tab_contents/navigation_controller.cc @@ -718,7 +718,7 @@ void NavigationController::RendererDidNavigateToNewPage( // Don't use the page type from the pending entry. Some interstitial page // may have set the type to interstitial. Once we commit, however, the page // type must always be normal. - new_entry->set_page_type(NORMAL_PAGE); + new_entry->set_page_type(NavigationEntry::NORMAL_PAGE); } else { new_entry = new NavigationEntry; } @@ -1200,7 +1200,8 @@ void NavigationController::InsertEntriesFrom( size_t insert_index = 0; for (int i = 0; i < max_index; i++) { // When cloning a tab, copy all entries except interstitial pages - if (source.entries_[i].get()->page_type() != INTERSTITIAL_PAGE) { + if (source.entries_[i].get()->page_type() != + NavigationEntry::INTERSTITIAL_PAGE) { entries_.insert(entries_.begin() + insert_index++, linked_ptr<NavigationEntry>( new NavigationEntry(*source.entries_[i]))); diff --git a/chrome/browser/tab_contents/navigation_controller_unittest.cc b/chrome/browser/tab_contents/navigation_controller_unittest.cc index 81010a9..8732b62 100644 --- a/chrome/browser/tab_contents/navigation_controller_unittest.cc +++ b/chrome/browser/tab_contents/navigation_controller_unittest.cc @@ -1374,7 +1374,8 @@ TEST_F(NavigationControllerTest, Interstitial) { // Now navigate somewhere with an interstitial. const GURL url2("http://bar"); controller().LoadURL(url1, GURL(), PageTransition::TYPED); - controller().pending_entry()->set_page_type(INTERSTITIAL_PAGE); + controller().pending_entry()->set_page_type( + NavigationEntry::INTERSTITIAL_PAGE); // At this point the interstitial will be displayed and the load will still // be pending. If the user continues, the load will commit. @@ -1382,7 +1383,8 @@ TEST_F(NavigationControllerTest, Interstitial) { // The page should be a normal page again. EXPECT_EQ(url2, controller().GetLastCommittedEntry()->url()); - EXPECT_EQ(NORMAL_PAGE, controller().GetLastCommittedEntry()->page_type()); + EXPECT_EQ(NavigationEntry::NORMAL_PAGE, + controller().GetLastCommittedEntry()->page_type()); } TEST_F(NavigationControllerTest, RemoveEntry) { @@ -1672,7 +1674,7 @@ TEST_F(NavigationControllerTest, CloneOmitsInterstitials) { // Add an interstitial entry. Should be deleted with controller. NavigationEntry* interstitial_entry = new NavigationEntry(); - interstitial_entry->set_page_type(INTERSTITIAL_PAGE); + interstitial_entry->set_page_type(NavigationEntry::INTERSTITIAL_PAGE); controller().AddTransientEntry(interstitial_entry); scoped_ptr<TabContents> clone(controller().tab_contents()->Clone()); diff --git a/chrome/browser/tab_contents/navigation_entry.h b/chrome/browser/tab_contents/navigation_entry.h index ca97e02..9a5f6a5 100644 --- a/chrome/browser/tab_contents/navigation_entry.h +++ b/chrome/browser/tab_contents/navigation_entry.h @@ -10,9 +10,8 @@ #include "base/basictypes.h" #include "base/ref_counted.h" -#include "chrome/common/page_type.h" +#include "chrome/browser/tab_contents/security_style.h" #include "chrome/common/page_transition_types.h" -#include "chrome/common/security_style.h" #include "googleurl/src/gurl.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -133,6 +132,13 @@ class NavigationEntry { // Copy and assignment is explicitly allowed for this class. }; + // The type of the page an entry corresponds to. Used by tests. + enum PageType { + NORMAL_PAGE = 0, + ERROR_PAGE, + INTERSTITIAL_PAGE + }; + // Favicon ------------------------------------------------------------------- // Collects the favicon related information for a NavigationEntry. diff --git a/chrome/browser/tab_contents/navigation_entry_unittest.cc b/chrome/browser/tab_contents/navigation_entry_unittest.cc index e28cf1c..db59464 100644 --- a/chrome/browser/tab_contents/navigation_entry_unittest.cc +++ b/chrome/browser/tab_contents/navigation_entry_unittest.cc @@ -134,10 +134,10 @@ TEST_F(NavigationEntryTest, NavigationEntryAccessors) { EXPECT_EQ(instance_, entry1_.get()->site_instance()); // Page type - EXPECT_EQ(NORMAL_PAGE, entry1_.get()->page_type()); - EXPECT_EQ(NORMAL_PAGE, entry2_.get()->page_type()); - entry2_.get()->set_page_type(INTERSTITIAL_PAGE); - EXPECT_EQ(INTERSTITIAL_PAGE, entry2_.get()->page_type()); + EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry1_.get()->page_type()); + EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry2_.get()->page_type()); + entry2_.get()->set_page_type(NavigationEntry::INTERSTITIAL_PAGE); + EXPECT_EQ(NavigationEntry::INTERSTITIAL_PAGE, entry2_.get()->page_type()); // Referrer EXPECT_EQ(GURL(), entry1_.get()->referrer()); diff --git a/chrome/common/security_style.h b/chrome/browser/tab_contents/security_style.h index 7d92d0e..9694646 100644 --- a/chrome/common/security_style.h +++ b/chrome/browser/tab_contents/security_style.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_SECURITY_STYLE_H_ -#define CHROME_COMMON_SECURITY_STYLE_H_ +#ifndef CHROME_BROWSER_TAB_CONTENTS_SECURITY_STYLE_H_ +#define CHROME_BROWSER_TAB_CONTENTS_SECURITY_STYLE_H_ #pragma once // Various aspects of the UI change their appearance according to the security @@ -32,4 +32,4 @@ enum SecurityStyle { SECURITY_STYLE_AUTHENTICATED, }; -#endif // CHROME_COMMON_SECURITY_STYLE_H_ +#endif // CHROME_BROWSER_TAB_CONTENTS_SECURITY_STYLE_H_ diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index c45d764..288b5b6 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -684,7 +684,7 @@ bool TabContents::ShouldDisplayURL() { // Don't hide the url in view source mode and with interstitials. NavigationEntry* entry = controller_.GetActiveEntry(); if (entry && (entry->IsViewSourceMode() || - entry->page_type() == INTERSTITIAL_PAGE)) { + entry->page_type() == NavigationEntry::INTERSTITIAL_PAGE)) { return true; } diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 0b89518..453138e 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1775,8 +1775,12 @@ 'sources': [ 'test/automation/autocomplete_edit_proxy.cc', 'test/automation/autocomplete_edit_proxy.h', + 'test/automation/automation_constants.h', 'test/automation/automation_handle_tracker.cc', 'test/automation/automation_handle_tracker.h', + 'test/automation/automation_messages.cc', + 'test/automation/automation_messages.h', + 'test/automation/automation_messages_internal.h', 'test/automation/automation_proxy.cc', 'test/automation/automation_proxy.h', 'test/automation/browser_proxy.cc', diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 31e293c..c17f7dc 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -3351,6 +3351,12 @@ 'browser/zygote_host_linux.cc', 'browser/zygote_main_linux.cc', + # TODO(erg): http://crbug.com/51409 These files are also specified as + # part of the automation project, but we need these definitions here, + # too, due to usage in our automation provider. + 'test/automation/automation_messages.cc', + 'test/automation/automation_messages.h', + # These files are generated by GRIT. '<(grit_out_dir)/grit/bookmark_manager_resources_map.cc', '<(grit_out_dir)/grit/shared_resources_map.cc', diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index d2e0a83..d4ca5b6 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -224,9 +224,6 @@ 'common/appcache/appcache_dispatcher.h', 'common/automation_constants.cc', 'common/automation_constants.h', - 'common/automation_messages.cc', - 'common/automation_messages.h', - 'common/automation_messages_internal.h', 'common/child_process_host.cc', 'common/child_process_host.h', 'common/chrome_descriptors.h', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 1bb8f08..0556402 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -6,9 +6,9 @@ 'variables' : { 'pyautolib_sources': [ 'app/chrome_dll_resource.h', - 'common/automation_constants.h', 'common/pref_names.cc', 'common/pref_names.h', + 'test/automation/automation_constants.h', 'test/automation/browser_proxy.cc', 'test/automation/browser_proxy.h', 'test/automation/tab_proxy.cc', diff --git a/chrome/common/automation_constants.h b/chrome/common/automation_constants.h index 13b120e..6959af7 100644 --- a/chrome/common/automation_constants.h +++ b/chrome/common/automation_constants.h @@ -15,42 +15,6 @@ extern const char kJSONProxyNoProxy[]; extern const char kJSONProxyPacUrl[]; extern const char kJSONProxyBypassList[]; extern const char kJSONProxyServer[]; - -// Amount of time to wait before querying the browser. -static const int kSleepTime = 250; } -// Used by AutomationProxy, declared here so that other headers don't need -// to include automation_proxy.h. -enum AutomationLaunchResult { - AUTOMATION_LAUNCH_RESULT_INVALID = -1, - AUTOMATION_SUCCESS, - AUTOMATION_TIMEOUT, - AUTOMATION_VERSION_MISMATCH, - AUTOMATION_CREATE_TAB_FAILED, - AUTOMATION_SERVER_CRASHED, -}; - -enum AutomationMsg_NavigationResponseValues { - AUTOMATION_MSG_NAVIGATION_ERROR = 0, - AUTOMATION_MSG_NAVIGATION_SUCCESS, - AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED, -}; - -enum AutomationMsg_ExtensionResponseValues { - AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED = 0, - AUTOMATION_MSG_EXTENSION_INSTALL_FAILED -}; - -// Used in the AutomationMsg_GetExtensionProperty to identify which extension -// property should be retrieved, instead of having separate messages for each -// property. -enum AutomationMsg_ExtensionProperty { - AUTOMATION_MSG_EXTENSION_ID = 0, - AUTOMATION_MSG_EXTENSION_NAME, - AUTOMATION_MSG_EXTENSION_VERSION, - AUTOMATION_MSG_EXTENSION_BROWSER_ACTION_INDEX, -}; - - #endif // CHROME_COMMON_AUTOMATION_CONSTANTS_H__ diff --git a/chrome/common/page_type.h b/chrome/common/page_type.h deleted file mode 100644 index 2a2bd1a..0000000 --- a/chrome/common/page_type.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2009 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 CHROME_COMMON_PAGE_TYPE_H_ -#define CHROME_COMMON_PAGE_TYPE_H_ -#pragma once - -// The type of the page an entry corresponds to. Used by chrome_frame and the -// automation layer to detect the state of a TabContents. -enum PageType { - NORMAL_PAGE = 0, - ERROR_PAGE, - INTERSTITIAL_PAGE -}; - -#endif // CHROME_COMMON_PAGE_TYPE_H_ diff --git a/chrome/test/automation/autocomplete_edit_proxy.cc b/chrome/test/automation/autocomplete_edit_proxy.cc index 184239a..5bfd13c 100644 --- a/chrome/test/automation/autocomplete_edit_proxy.cc +++ b/chrome/test/automation/autocomplete_edit_proxy.cc @@ -6,8 +6,8 @@ #include <vector> -#include "chrome/common/automation_constants.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_constants.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" using base::TimeDelta; diff --git a/chrome/test/automation/automation_constants.h b/chrome/test/automation/automation_constants.h new file mode 100644 index 0000000..f34c0f2 --- /dev/null +++ b/chrome/test/automation/automation_constants.h @@ -0,0 +1,46 @@ +// Copyright (c) 2009 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 CHROME_TEST_AUTOMATION_AUTOMATION_CONSTANTS_H_ +#define CHROME_TEST_AUTOMATION_AUTOMATION_CONSTANTS_H_ +#pragma once + +namespace automation { +// Amount of time to wait before querying the browser. +static const int kSleepTime = 250; +} + +// Used by AutomationProxy, declared here so that other headers don't need +// to include automation_proxy.h. +enum AutomationLaunchResult { + AUTOMATION_LAUNCH_RESULT_INVALID = -1, + AUTOMATION_SUCCESS, + AUTOMATION_TIMEOUT, + AUTOMATION_VERSION_MISMATCH, + AUTOMATION_CREATE_TAB_FAILED, + AUTOMATION_SERVER_CRASHED, +}; + +enum AutomationMsg_NavigationResponseValues { + AUTOMATION_MSG_NAVIGATION_ERROR = 0, + AUTOMATION_MSG_NAVIGATION_SUCCESS, + AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED, +}; + +enum AutomationMsg_ExtensionResponseValues { + AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED = 0, + AUTOMATION_MSG_EXTENSION_INSTALL_FAILED +}; + +// Used in the AutomationMsg_GetExtensionProperty to identify which extension +// property should be retrieved, instead of having separate messages for each +// property. +enum AutomationMsg_ExtensionProperty { + AUTOMATION_MSG_EXTENSION_ID = 0, + AUTOMATION_MSG_EXTENSION_NAME, + AUTOMATION_MSG_EXTENSION_VERSION, + AUTOMATION_MSG_EXTENSION_BROWSER_ACTION_INDEX, +}; + +#endif // CHROME_TEST_AUTOMATION_AUTOMATION_CONSTANTS_H_ diff --git a/chrome/test/automation/automation_handle_tracker.cc b/chrome/test/automation/automation_handle_tracker.cc index b5613a5..ab29c2a 100644 --- a/chrome/test/automation/automation_handle_tracker.cc +++ b/chrome/test/automation/automation_handle_tracker.cc @@ -4,7 +4,7 @@ #include "chrome/test/automation/automation_handle_tracker.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" AutomationResourceProxy::AutomationResourceProxy( diff --git a/chrome/common/automation_messages.cc b/chrome/test/automation/automation_messages.cc index df6d0e2..8c26327 100644 --- a/chrome/common/automation_messages.cc +++ b/chrome/test/automation/automation_messages.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/common/automation_messages_internal.h" + "chrome/test/automation/automation_messages_internal.h" #include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/automation_messages.h b/chrome/test/automation/automation_messages.h index b4b22cd..bb6d866 100644 --- a/chrome/common/automation_messages.h +++ b/chrome/test/automation/automation_messages.h @@ -2,20 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_AUTOMATION_MESSAGES_H__ -#define CHROME_COMMON_AUTOMATION_MESSAGES_H__ +#ifndef CHROME_TEST_AUTOMATION_AUTOMATION_MESSAGES_H__ +#define CHROME_TEST_AUTOMATION_AUTOMATION_MESSAGES_H__ #pragma once #include <string> #include "base/basictypes.h" -#include "chrome/common/automation_constants.h" +#include "chrome/browser/tab_contents/navigation_entry.h" +#include "chrome/browser/tab_contents/security_style.h" #include "chrome/common/common_param_traits.h" -#include "chrome/common/page_type.h" -#include "chrome/common/security_style.h" +#include "chrome/test/automation/automation_constants.h" #include "gfx/rect.h" #include "net/base/upload_data.h" + struct AutomationMsg_Find_Params { // Unused value, which exists only for backwards compat. int unused; @@ -198,8 +199,8 @@ struct ParamTraits<SecurityStyle> { }; template <> -struct ParamTraits<PageType> { - typedef PageType param_type; +struct ParamTraits<NavigationEntry::PageType> { + typedef NavigationEntry::PageType param_type; static void Write(Message* m, const param_type& p) { m->WriteInt(p); } @@ -207,19 +208,19 @@ struct ParamTraits<PageType> { int type; if (!m->ReadInt(iter, &type)) return false; - *p = static_cast<PageType>(type); + *p = static_cast<NavigationEntry::PageType>(type); return true; } static void Log(const param_type& p, std::string* l) { std::string control; switch (p) { - case NORMAL_PAGE: + case NavigationEntry::NORMAL_PAGE: control = "NORMAL_PAGE"; break; - case ERROR_PAGE: + case NavigationEntry::ERROR_PAGE: control = "ERROR_PAGE"; break; - case INTERSTITIAL_PAGE: + case NavigationEntry::INTERSTITIAL_PAGE: control = "INTERSTITIAL_PAGE"; break; default: @@ -519,7 +520,7 @@ struct ParamTraits<NavigationInfo> { }; // A stripped down version of ContextMenuParams in webkit/glue/context_menu.h. -struct MiniContextMenuParams { +struct ContextMenuParams { // The x coordinate for displaying the menu. int screen_x; @@ -547,10 +548,10 @@ struct MiniContextMenuParams { GURL frame_url; }; -// Traits for MiniContextMenuParams structure to pack/unpack. +// Traits for ContextMenuParams structure to pack/unpack. template <> -struct ParamTraits<MiniContextMenuParams> { - typedef MiniContextMenuParams param_type; +struct ParamTraits<ContextMenuParams> { + typedef ContextMenuParams param_type; static void Write(Message* m, const param_type& p) { WriteParam(m, p.screen_x); WriteParam(m, p.screen_y); @@ -638,7 +639,7 @@ struct ParamTraits<AttachExternalTabParams> { } // namespace IPC #define MESSAGES_INTERNAL_FILE \ - "chrome/common/automation_messages_internal.h" + "chrome/test/automation/automation_messages_internal.h" #include "ipc/ipc_message_macros.h" -#endif // CHROME_COMMON_AUTOMATION_MESSAGES_H__ +#endif // CHROME_TEST_AUTOMATION_AUTOMATION_MESSAGES_H__ diff --git a/chrome/common/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index ab3c97c..adadf68 100644 --- a/chrome/common/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -611,8 +611,9 @@ IPC_BEGIN_MESSAGES(Automation) // - int: handle of the tab // Response: // - bool: whether the operation was successful. - // - PageType: the type of the page currently displayed. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_GetPageType, int, bool, PageType) + // - NavigationEntry::PageType: the type of the page currently displayed. + IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_GetPageType, int, bool, + NavigationEntry::PageType) // This message simulates the user action on the SSL blocking page showing in // the specified tab. This message is only effective if an interstitial page @@ -951,7 +952,7 @@ IPC_BEGIN_MESSAGES(Automation) int /* tab_handle */, HANDLE /* source menu handle */, int /* align flags */, - IPC::MiniContextMenuParams /* params */) + IPC::ContextMenuParams /* params */) IPC_MESSAGE_ROUTED2(AutomationMsg_ForwardContextMenuCommandToChrome, int /* tab_handle */, diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index 74b7a94f..3f6eb64 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -14,9 +14,9 @@ #include "base/process_util.h" #include "base/ref_counted.h" #include "base/waitable_event.h" -#include "chrome/common/automation_constants.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_version_info.h" +#include "chrome/test/automation/automation_constants.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/extension_proxy.h" #include "chrome/test/automation/tab_proxy.h" diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h index b54dc10..344c248 100644 --- a/chrome/test/automation/automation_proxy.h +++ b/chrome/test/automation/automation_proxy.h @@ -18,7 +18,7 @@ #include "base/thread.h" #include "base/waitable_event.h" #include "chrome/browser/browser.h" -#include "chrome/common/automation_constants.h" +#include "chrome/test/automation/automation_constants.h" #include "chrome/test/automation/automation_handle_tracker.h" #include "chrome/test/automation/browser_proxy.h" #include "gfx/native_widget_types.h" diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc index c1b41cd..a43c9e2 100644 --- a/chrome/test/automation/automation_proxy_uitest.cc +++ b/chrome/test/automation/automation_proxy_uitest.cc @@ -17,11 +17,11 @@ #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/net/url_request_slow_http_job.h" #include "chrome/browser/view_ids.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/json_value_serializer.h" #include "chrome/test/automation/autocomplete_edit_proxy.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy_uitest.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc index 88d833a..b5a89eb 100644 --- a/chrome/test/automation/browser_proxy.cc +++ b/chrome/test/automation/browser_proxy.cc @@ -11,9 +11,9 @@ #include "base/logging.h" #include "base/platform_thread.h" #include "base/time.h" -#include "chrome/common/automation_constants.h" -#include "chrome/common/automation_messages.h" #include "chrome/test/automation/autocomplete_edit_proxy.h" +#include "chrome/test/automation/automation_constants.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" diff --git a/chrome/test/automation/extension_proxy.cc b/chrome/test/automation/extension_proxy.cc index 4390c10..29fd54c 100644 --- a/chrome/test/automation/extension_proxy.cc +++ b/chrome/test/automation/extension_proxy.cc @@ -5,7 +5,7 @@ #include "chrome/test/automation/extension_proxy.h" #include "base/string_number_conversions.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" #include "chrome/test/automation/browser_proxy.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/test/automation/extension_proxy.h b/chrome/test/automation/extension_proxy.h index ac4d7ec..485d469 100644 --- a/chrome/test/automation/extension_proxy.h +++ b/chrome/test/automation/extension_proxy.h @@ -9,7 +9,7 @@ #include <string> #include "base/compiler_specific.h" -#include "chrome/common/automation_constants.h" +#include "chrome/test/automation/automation_constants.h" #include "chrome/test/automation/automation_handle_tracker.h" class AutomationMessageSender; diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index fbd837c..a338de7 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -9,8 +9,9 @@ #include "base/logging.h" #include "base/string16.h" #include "base/utf_string_conversions.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/json_value_serializer.h" +#include "chrome/test/automation/automation_constants.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" #include "googleurl/src/gurl.h" @@ -605,7 +606,7 @@ bool TabProxy::GetSecurityState(SecurityStyle* security_style, return succeeded; } -bool TabProxy::GetPageType(PageType* type) { +bool TabProxy::GetPageType(NavigationEntry::PageType* type) { DCHECK(type); if (!is_valid()) diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h index c4b1ee7..92a80a7 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -18,9 +18,9 @@ #include "base/compiler_specific.h" #include "base/observer_list.h" #include "chrome/browser/download/save_package.h" -#include "chrome/common/automation_constants.h" -#include "chrome/common/page_type.h" -#include "chrome/common/security_style.h" +#include "chrome/browser/tab_contents/navigation_entry.h" +#include "chrome/browser/tab_contents/security_style.h" +#include "chrome/test/automation/automation_constants.h" #include "chrome/test/automation/automation_handle_tracker.h" #include "chrome/test/automation/dom_element_proxy.h" #include "chrome/test/automation/javascript_execution_controller.h" @@ -323,7 +323,7 @@ class TabProxy : public AutomationResourceProxy, // Returns the type of the page currently showing (normal, interstitial, // error). - bool GetPageType(PageType* page_type) WARN_UNUSED_RESULT; + bool GetPageType(NavigationEntry::PageType* page_type) WARN_UNUSED_RESULT; // Simulates the user action on the SSL blocking page. if |proceed| is true, // this is equivalent to clicking the 'Proceed' button, if false to 'Take me diff --git a/chrome/test/automation/window_proxy.cc b/chrome/test/automation/window_proxy.cc index 6774e6d..1a66edc 100644 --- a/chrome/test/automation/window_proxy.cc +++ b/chrome/test/automation/window_proxy.cc @@ -8,8 +8,8 @@ #include <algorithm> #include "base/logging.h" -#include "chrome/common/automation_constants.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_constants.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" diff --git a/chrome/test/pyautolib/pyautolib.i b/chrome/test/pyautolib/pyautolib.i index eb4ebbe..875d530 100644 --- a/chrome/test/pyautolib/pyautolib.i +++ b/chrome/test/pyautolib/pyautolib.i @@ -27,12 +27,12 @@ // Headers that can be swigged directly. %include "chrome/app/chrome_dll_resource.h" -%include "chrome/common/automation_constants.h" %include "chrome/common/pref_names.h" +%include "chrome/test/automation/automation_constants.h" %{ -#include "chrome/common/automation_constants.h" #include "chrome/common/pref_names.h" +#include "chrome/test/automation/automation_constants.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/pyautolib/pyautolib.h" diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index 571c16a..770f0f2 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -50,7 +50,6 @@ #include "chrome/browser/browser_thread.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/prefs/pref_service.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" @@ -59,6 +58,7 @@ #include "chrome/common/logging_chrome.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 7c7deb7b..8c72435 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -30,7 +30,6 @@ #include "base/utf_string_conversions.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/net/url_fixer_upper.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" @@ -38,6 +37,7 @@ #include "chrome/common/logging_chrome.h" #include "chrome/common/json_value_serializer.h" #include "chrome/common/url_constants.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/javascript_execution_controller.h" diff --git a/chrome_frame/cfproxy.h b/chrome_frame/cfproxy.h index c414df7..bfcc998 100644 --- a/chrome_frame/cfproxy.h +++ b/chrome_frame/cfproxy.h @@ -13,8 +13,8 @@ #include "base/lock.h" #include "base/time.h" // for base::TimeDelta #include "base/file_path.h" -#include "chrome/common/automation_constants.h" #include "chrome/common/page_zoom.h" +#include "chrome/test/automation/automation_constants.h" enum FindInPageDirection { BACK = 0, FWD = 1 }; enum FindInPageCase { IGNORE_CASE = 0, CASE_SENSITIVE = 1 }; @@ -34,7 +34,7 @@ namespace IPC { struct NavigationInfo; struct AutomationURLRequest; struct AttachExternalTabParams; - struct MiniContextMenuParams; + struct ContextMenuParams; }; class GURL; @@ -196,7 +196,7 @@ class ChromeProxyDelegate { // Misc. UI. virtual void HandleAccelerator(const MSG& accel_message) = 0; virtual void HandleContextMenu(HANDLE menu_handle, int align_flags, - const IPC::MiniContextMenuParams& params) = 0; + const IPC::ContextMenuParams& params) = 0; virtual void TabbedOut(bool reverse) = 0; // Tab related. diff --git a/chrome_frame/cfproxy_proxy.cc b/chrome_frame/cfproxy_proxy.cc index 15f40ff..e03cb0e 100644 --- a/chrome_frame/cfproxy_proxy.cc +++ b/chrome_frame/cfproxy_proxy.cc @@ -6,7 +6,7 @@ #include "base/tuple.h" #include "ipc/ipc_sync_message.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" CFProxy::CFProxy(CFProxyTraits* api) : ipc_thread_("ipc"), sync_dispatcher_(&tab2delegate_), diff --git a/chrome_frame/cfproxy_support.cc b/chrome_frame/cfproxy_support.cc index 162d039..42e6a28 100644 --- a/chrome_frame/cfproxy_support.cc +++ b/chrome_frame/cfproxy_support.cc @@ -8,8 +8,8 @@ #include "base/atomic_sequence_num.h" #include "base/command_line.h" #include "base/process_util.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_switches.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome_frame/chrome_launcher_utils.h" #include "chrome_frame/utils.h" // for IsHeadlessMode(); diff --git a/chrome_frame/cfproxy_test.cc b/chrome_frame/cfproxy_test.cc index a8c69f3..28ba8c6 100644 --- a/chrome_frame/cfproxy_test.cc +++ b/chrome_frame/cfproxy_test.cc @@ -5,8 +5,8 @@ #include <string> #include "base/file_path.h" #include "base/waitable_event.h" -#include "chrome/common/automation_messages.h" #include "chrome_frame/cfproxy_private.h" +#include "chrome/test/automation/automation_messages.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock_mutant.h" @@ -73,7 +73,7 @@ struct MockChromeProxyDelegate : public ChromeProxyDelegate { // Misc. UI. MOCK_METHOD1(HandleAccelerator, void(const MSG& accel_message)); MOCK_METHOD3(HandleContextMenu, void(HANDLE menu_handle, int align_flags, - const IPC::MiniContextMenuParams& params)); + const IPC::ContextMenuParams& params)); MOCK_METHOD1(TabbedOut, void(bool reverse)); // @@ -472,7 +472,7 @@ TEST(Deserialize, DispatchTabMessage) { EXPECT_TRUE(DispatchTabMessageToDelegate(&delegate, m9)); // Tuple4<int, HANDLE, int, IPC::ContextMenuParams> - IPC::MiniContextMenuParams ctxmenu = { 711, 512, GURL("http://link_src"), + IPC::ContextMenuParams ctxmenu = { 711, 512, GURL("http://link_src"), GURL("http://unfiltered_link_url"), GURL("http://src_url"), GURL("http://page_url"), GURL("http://frame_url") }; AutomationMsg_ForwardContextMenuToExternalHost m10(0, 1, HANDLE(7), 4, diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index 1f4aa4b..9dfe739 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -31,6 +31,7 @@ #include "base/win/scoped_variant.h" #include "grit/generated_resources.h" #include "chrome/app/chrome_dll_resource.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/navigation_types.h" #include "chrome/common/page_zoom.h" @@ -969,7 +970,7 @@ bool ChromeActiveDocument::PreProcessContextMenu(HMENU menu) { } bool ChromeActiveDocument::HandleContextMenuCommand(UINT cmd, - const IPC::MiniContextMenuParams& params) { + const IPC::ContextMenuParams& params) { ScopedComPtr<IWebBrowser2> web_browser2; DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); diff --git a/chrome_frame/chrome_active_document.h b/chrome_frame/chrome_active_document.h index 5723e7ff..482a672 100644 --- a/chrome_frame/chrome_active_document.h +++ b/chrome_frame/chrome_active_document.h @@ -344,8 +344,7 @@ END_EXEC_COMMAND_MAP() // Callbacks from ChromeFramePlugin<T> bool PreProcessContextMenu(HMENU menu); - bool HandleContextMenuCommand(UINT cmd, - const IPC::MiniContextMenuParams& params); + bool HandleContextMenuCommand(UINT cmd, const IPC::ContextMenuParams& params); // ChromeFramePlugin overrides. virtual void OnAutomationServerReady(); diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index 116deb6..def29b8 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -358,7 +358,7 @@ END_MSG_MAP() } bool HandleContextMenuCommand(UINT cmd, - const IPC::MiniContextMenuParams& params) { + const IPC::ContextMenuParams& params) { if (cmd == IDC_ABOUT_CHROME_FRAME) { int tab_handle = automation_client_->tab()->handle(); HostNavigate(GURL("about:version"), GURL(), NEW_WINDOW); @@ -519,7 +519,7 @@ END_MSG_MAP() virtual void OnHandleContextMenu(int tab_handle, HANDLE menu_handle, int align_flags, - const IPC::MiniContextMenuParams& params) { + const IPC::ContextMenuParams& params) { scoped_refptr<BasePlugin> ref(this); ChromeFramePlugin<T>::OnHandleContextMenu(tab_handle, menu_handle, align_flags, params); diff --git a/chrome_frame/chrome_frame_delegate.h b/chrome_frame/chrome_frame_delegate.h index c7890b7..b57cc5b 100644 --- a/chrome_frame/chrome_frame_delegate.h +++ b/chrome_frame/chrome_frame_delegate.h @@ -13,7 +13,7 @@ #include "base/file_path.h" #include "base/lock.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "ipc/ipc_message.h" // A common interface supported by all the browser specific ChromeFrame @@ -108,7 +108,7 @@ class ChromeFrameDelegateImpl : public ChromeFrameDelegate { const std::string& target) {} virtual void OnHandleContextMenu(int tab_handle, HANDLE menu_handle, int align_flags, - const IPC::MiniContextMenuParams& params) {} + const IPC::ContextMenuParams& params) {} virtual void OnRequestStart(int tab_handle, int request_id, const IPC::AutomationURLRequest& request) {} virtual void OnRequestRead(int tab_handle, int request_id, diff --git a/chrome_frame/chrome_frame_npapi.cc b/chrome_frame/chrome_frame_npapi.cc index 5668a5b..9ea07df 100644 --- a/chrome_frame/chrome_frame_npapi.cc +++ b/chrome_frame/chrome_frame_npapi.cc @@ -1476,7 +1476,7 @@ bool ChromeFrameNPAPI::PreProcessContextMenu(HMENU menu) { } bool ChromeFrameNPAPI::HandleContextMenuCommand(UINT cmd, - const IPC::MiniContextMenuParams& params) { + const IPC::ContextMenuParams& params) { if (cmd == IDC_ABOUT_CHROME_FRAME) { // TODO: implement "About Chrome Frame" } diff --git a/chrome_frame/chrome_frame_npapi.h b/chrome_frame/chrome_frame_npapi.h index d606090..5101592 100644 --- a/chrome_frame/chrome_frame_npapi.h +++ b/chrome_frame/chrome_frame_npapi.h @@ -128,8 +128,7 @@ END_MSG_MAP() static void InitializeIdentifiers(); bool PreProcessContextMenu(HMENU menu); - bool HandleContextMenuCommand(UINT cmd, - const IPC::MiniContextMenuParams& params); + bool HandleContextMenuCommand(UINT cmd, const IPC::ContextMenuParams& params); protected: // Handler for accelerator messages passed on from the hosted chrome // instance. diff --git a/chrome_frame/chrome_frame_plugin.h b/chrome_frame/chrome_frame_plugin.h index 58a76a6..9ea6ce9 100644 --- a/chrome_frame/chrome_frame_plugin.h +++ b/chrome_frame/chrome_frame_plugin.h @@ -120,7 +120,7 @@ END_MSG_MAP() virtual void OnHandleContextMenu(int tab_handle, HANDLE menu_handle, int align_flags, - const IPC::MiniContextMenuParams& params) { + const IPC::ContextMenuParams& params) { if (!menu_handle || !automation_client_.get()) { NOTREACHED(); return; @@ -219,7 +219,7 @@ END_MSG_MAP() // Return true if menu command is processed, otherwise the command will be // passed to Chrome for execution. Override in most-derived class if needed. bool HandleContextMenuCommand(UINT cmd, - const IPC::MiniContextMenuParams& params) { + const IPC::ContextMenuParams& params) { return false; } diff --git a/chrome_frame/external_tab.cc b/chrome_frame/external_tab.cc index edc1ad9..4bfeff2 100644 --- a/chrome_frame/external_tab.cc +++ b/chrome_frame/external_tab.cc @@ -7,7 +7,7 @@ #include "base/tracked.h" #include "base/task.h" #include "base/waitable_event.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome_frame/utils.h" DISABLE_RUNNABLE_METHOD_REFCOUNT(ExternalTabProxy); @@ -271,10 +271,8 @@ void ExternalTabProxy::HandleAccelerator(const MSG& accel_message) { &UIDelegate::OnHandleAccelerator, accel_message)); } -void ExternalTabProxy::HandleContextMenu( - HANDLE menu_handle, - int align_flags, - const IPC::MiniContextMenuParams& params) { +void ExternalTabProxy::HandleContextMenu(HANDLE menu_handle, int align_flags, + const IPC::ContextMenuParams& params) { ui_.PostTask(FROM_HERE, NewRunnableMethod(ui_delegate_, &UIDelegate::OnHandleContextMenu, menu_handle, align_flags, params)); } diff --git a/chrome_frame/external_tab.h b/chrome_frame/external_tab.h index 6f890ed..b68a9bf 100644 --- a/chrome_frame/external_tab.h +++ b/chrome_frame/external_tab.h @@ -14,8 +14,8 @@ #include "base/scoped_comptr_win.h" #include "base/scoped_ptr.h" #include "base/time.h" -#include "chrome/common/automation_constants.h" -#include "chrome/common/page_zoom.h" +#include "chrome/common//page_zoom.h" +#include "chrome/test/automation/automation_constants.h" #include "chrome_frame/cfproxy.h" #include "chrome_frame/task_marshaller.h" #include "googleurl/src/gurl.h" @@ -29,7 +29,7 @@ namespace base { namespace IPC { struct NavigationInfo; - struct MiniContextMenuParams; + struct ContextMenuParams; } // This is the delegate/callback interface that has to be implemented @@ -45,7 +45,7 @@ class UIDelegate { virtual void OnMessageFromChromeFrame(const std::string& message, const std::string& origin, const std::string& target) = 0; virtual void OnHandleContextMenu(HANDLE menu_handle, int align_flags, - const IPC::MiniContextMenuParams& params) = 0; + const IPC::ContextMenuParams& params) = 0; virtual void OnHandleAccelerator(const MSG& accel_message) = 0; virtual void OnTabbedOut(bool reverse) = 0; virtual void OnGoToHistoryOffset(int offset) = 0; @@ -165,7 +165,7 @@ class ExternalTabProxy : public CWindowImpl<ExternalTabProxy>, // Misc. UI. virtual void HandleAccelerator(const MSG& accel_message); virtual void HandleContextMenu(HANDLE menu_handle, int align_flags, - const IPC::MiniContextMenuParams& params); + const IPC::ContextMenuParams& params); virtual void TabbedOut(bool reverse); // Other diff --git a/chrome_frame/external_tab_test.cc b/chrome_frame/external_tab_test.cc index 1448c34..0e49f95 100644 --- a/chrome_frame/external_tab_test.cc +++ b/chrome_frame/external_tab_test.cc @@ -9,7 +9,7 @@ // #include "base/waitable_event.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock_mutant.h" @@ -41,7 +41,7 @@ struct MockUIDelegate : public UIDelegate { MOCK_METHOD3(OnMessageFromChromeFrame, void(const std::string& message, const std::string& origin, const std::string& target)); MOCK_METHOD3(OnHandleContextMenu, void(HANDLE menu_handle, int align_flags, - const IPC::MiniContextMenuParams& params)); + const IPC::ContextMenuParams& params)); MOCK_METHOD1(OnHandleAccelerator, void(const MSG& accel_message)); MOCK_METHOD1(OnTabbedOut, void(bool reverse)); MOCK_METHOD1(OnGoToHistoryOffset, void(int offset)); diff --git a/chrome_frame/plugin_url_request.cc b/chrome_frame/plugin_url_request.cc index 236090b..c4bf932 100644 --- a/chrome_frame/plugin_url_request.cc +++ b/chrome_frame/plugin_url_request.cc @@ -4,7 +4,7 @@ #include "chrome_frame/plugin_url_request.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome_frame/np_browser_functions.h" PluginUrlRequest::PluginUrlRequest() diff --git a/chrome_frame/test/automation_client_mock.h b/chrome_frame/test/automation_client_mock.h index 58928b8..2ac30e8 100644 --- a/chrome_frame/test/automation_client_mock.h +++ b/chrome_frame/test/automation_client_mock.h @@ -51,7 +51,7 @@ struct MockCFDelegate : public ChromeFrameDelegateImpl { const std::string& origin, const std::string& target)); MOCK_METHOD4(OnHandleContextMenu, void(int tab_handle, HANDLE menu_handle, - int align_flags, const IPC::MiniContextMenuParams& params)); + int align_flags, const IPC::ContextMenuParams& params)); MOCK_METHOD3(OnRequestStart, void(int tab_handle, int request_id, const IPC::AutomationURLRequest& request)); MOCK_METHOD3(OnRequestRead, void(int tab_handle, int request_id, diff --git a/chrome_frame/test/net/test_automation_provider.cc b/chrome_frame/test/net/test_automation_provider.cc index 5b8a9a6..7594f30 100644 --- a/chrome_frame/test/net/test_automation_provider.cc +++ b/chrome_frame/test/net/test_automation_provider.cc @@ -7,7 +7,7 @@ #include "base/command_line.h" #include "base/file_version_info.h" #include "base/path_service.h" -#include "chrome/common/automation_messages.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome_frame/test/net/test_automation_resource_message_filter.h" namespace { diff --git a/chrome_frame/test/reliability/page_load_test.cc b/chrome_frame/test/reliability/page_load_test.cc index 4116464..482e00e 100644 --- a/chrome_frame/test/reliability/page_load_test.cc +++ b/chrome_frame/test/reliability/page_load_test.cc @@ -37,7 +37,6 @@ #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/pref_value_store.h" -#include "chrome/common/automation_messages.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths_internal.h" @@ -47,6 +46,7 @@ #include "chrome/common/pref_names.h" #include "chrome_frame/test/chrome_frame_test_utils.h" #include "chrome_frame/test/ie_event_sink.h" +#include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" diff --git a/ipc/ipc_message_impl_macros.h b/ipc/ipc_message_impl_macros.h index b601518..a9c38bd 100644 --- a/ipc/ipc_message_impl_macros.h +++ b/ipc/ipc_message_impl_macros.h @@ -22,7 +22,6 @@ // don't understand #include MESSAGES_INTERNAL_FILE. See http://crbug.com/7828 #if 0 #include "ipc/ipc_sync_message_unittest.h" -#include "chrome/common/automation_messages_internal.h" #include "chrome/common/devtools_messages_internal.h" #include "chrome/common/gpu_messages_internal.h" #include "chrome/common/nacl_messages_internal.h" @@ -31,6 +30,7 @@ #include "chrome/common/service_messages_internal.h" #include "chrome/common/utility_messages_internal.h" #include "chrome/common/worker_messages_internal.h" +#include "chrome/test/automation/automation_messages_internal.h" #endif // These are probalby still defined because of ipc_message_macros.h should be diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h index 79e3b16..39c4e38 100644 --- a/ipc/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h @@ -51,10 +51,10 @@ // don't understand #include MESSAGES_INTERNAL_FILE. See http://crbug.com/7828 #if 0 #include "ipc/ipc_sync_message_unittest.h" -#include "chrome/common/automation_messages_internal.h" -#include "chrome/common/devtools_messages_internal.h" #include "chrome/common/plugin_messages_internal.h" #include "chrome/common/render_messages_internal.h" +#include "chrome/common/devtools_messages_internal.h" +#include "chrome/test/automation/automation_messages_internal.h" #include "chrome/common/worker_messages_internal.h" #endif |