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 /chrome/browser | |
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
Diffstat (limited to 'chrome/browser')
27 files changed, 91 insertions, 46 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/browser/tab_contents/security_style.h b/chrome/browser/tab_contents/security_style.h new file mode 100644 index 0000000..9694646 --- /dev/null +++ b/chrome/browser/tab_contents/security_style.h @@ -0,0 +1,35 @@ +// Copyright (c) 2006-2008 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_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 +// context in which they are displayed. For example, the location bar displays +// a lock icon when it is displayed during a valid SSL connection. +// SecuirtySyle enumerates these styles, but it is up to the UI elements to +// adjust their display appropriately. +enum SecurityStyle { + // SECURITY_STYLE_UNKNOWN indicates that we do not know the proper security + // style for this object. + SECURITY_STYLE_UNKNOWN, + + // SECURITY_STYLE_UNAUTHENTICATED means the authenticity of this object can + // not be determined, either because it was retrieved using an unauthenticated + // protocol, such as HTTP or FTP, or it was retrieved using a protocol that + // supports authentication, such as HTTPS, but there were errors during + // transmission that render us uncertain to the object's authenticity. + SECURITY_STYLE_UNAUTHENTICATED, + + // SECURITY_STYLE_AUTHENTICATION_BROKEN indicates that we tried to retrieve + // this object in an authenticated manner but were unable to do so. + SECURITY_STYLE_AUTHENTICATION_BROKEN, + + // SECURITY_STYLE_AUTHENTICATED indicates that we successfully retrieved this + // object over an authenticated protocol, such as HTTPS. + SECURITY_STYLE_AUTHENTICATED, +}; + +#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; } |