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/tab_contents | |
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/tab_contents')
7 files changed, 57 insertions, 13 deletions
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; } |