summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-08 11:10:31 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-08 11:10:31 +0000
commitca5190f88042b04a0141b9718eea2c371adffc0a (patch)
tree1becace286d61147b538ca0f123823b26c78af84 /components
parentff69726e87952051dc6137db75524349aa59aff5 (diff)
downloadchromium_src-ca5190f88042b04a0141b9718eea2c371adffc0a.zip
chromium_src-ca5190f88042b04a0141b9718eea2c371adffc0a.tar.gz
chromium_src-ca5190f88042b04a0141b9718eea2c371adffc0a.tar.bz2
Disable rAc() on broken SSL.
R=isherman@chromium.org TBR=tsepez@chromium.org BUG=256815 TEST=manual Review URL: https://chromiumcodereview.appspot.com/18590003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r--components/autofill/content/browser/autocheckout_manager.cc17
-rw-r--r--components/autofill/content/browser/autocheckout_manager.h17
-rw-r--r--components/autofill/content/browser/autocheckout_manager_unittest.cc24
-rw-r--r--components/autofill/content/renderer/autofill_agent.cc22
-rw-r--r--components/autofill/core/DEPS1
-rw-r--r--components/autofill/core/browser/autofill_manager.cc5
-rw-r--r--components/autofill/core/browser/autofill_manager.h1
-rw-r--r--components/autofill/core/browser/autofill_manager_delegate.h1
-rw-r--r--components/autofill/core/common/autofill_messages.h1
-rw-r--r--components/autofill/core/common/form_data.cc16
-rw-r--r--components/autofill/core/common/form_data.h3
11 files changed, 31 insertions, 77 deletions
diff --git a/components/autofill/content/browser/autocheckout_manager.cc b/components/autofill/content/browser/autocheckout_manager.cc
index 79b37334..849b591 100644
--- a/components/autofill/content/browser/autocheckout_manager.cc
+++ b/components/autofill/content/browser/autocheckout_manager.cc
@@ -35,7 +35,6 @@
#include "url/gurl.h"
using content::RenderViewHost;
-using content::SSLStatus;
using content::WebContents;
namespace autofill {
@@ -294,7 +293,6 @@ bool AutocheckoutManager::ShouldIgnoreAjax() {
void AutocheckoutManager::MaybeShowAutocheckoutBubble(
const GURL& frame_url,
- const content::SSLStatus& ssl_status,
const gfx::RectF& bounding_box) {
if (autocheckout_offered_ ||
is_autocheckout_bubble_showing_ ||
@@ -305,7 +303,6 @@ void AutocheckoutManager::MaybeShowAutocheckoutBubble(
&AutocheckoutManager::ShowAutocheckoutBubble,
weak_ptr_factory_.GetWeakPtr(),
frame_url,
- ssl_status,
bounding_box);
content::WebContents* web_contents = autofill_manager_->GetWebContents();
@@ -396,20 +393,18 @@ void AutocheckoutManager::set_metric_logger(
void AutocheckoutManager::MaybeShowAutocheckoutDialog(
const GURL& frame_url,
- const SSLStatus& ssl_status,
bool show_dialog) {
is_autocheckout_bubble_showing_ = false;
if (!show_dialog)
return;
- FormData form = BuildAutocheckoutFormData();
- form.ssl_status = ssl_status;
-
base::Callback<void(const FormStructure*, const std::string&)> callback =
base::Bind(&AutocheckoutManager::ReturnAutocheckoutData,
weak_ptr_factory_.GetWeakPtr());
- autofill_manager_->ShowRequestAutocompleteDialog(
- form, frame_url, DIALOG_TYPE_AUTOCHECKOUT, callback);
+ autofill_manager_->ShowRequestAutocompleteDialog(BuildAutocheckoutFormData(),
+ frame_url,
+ DIALOG_TYPE_AUTOCHECKOUT,
+ callback);
for (std::map<int, std::vector<AutocheckoutStepType> >::const_iterator
it = page_meta_data_->page_types.begin();
@@ -422,7 +417,6 @@ void AutocheckoutManager::MaybeShowAutocheckoutDialog(
void AutocheckoutManager::ShowAutocheckoutBubble(
const GURL& frame_url,
- const content::SSLStatus& ssl_status,
const gfx::RectF& bounding_box,
const std::string& cookies) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -430,8 +424,7 @@ void AutocheckoutManager::ShowAutocheckoutBubble(
base::Callback<void(bool)> callback = base::Bind(
&AutocheckoutManager::MaybeShowAutocheckoutDialog,
weak_ptr_factory_.GetWeakPtr(),
- frame_url,
- ssl_status);
+ frame_url);
autofill_manager_->delegate()->ShowAutocheckoutBubble(
bounding_box,
cookies.find("LSID") != std::string::npos,
diff --git a/components/autofill/content/browser/autocheckout_manager.h b/components/autofill/content/browser/autocheckout_manager.h
index 84faf66..45b78f5 100644
--- a/components/autofill/content/browser/autocheckout_manager.h
+++ b/components/autofill/content/browser/autocheckout_manager.h
@@ -19,10 +19,6 @@
class GURL;
-namespace content {
-struct SSLStatus;
-}
-
namespace gfx {
class RectF;
}
@@ -69,10 +65,9 @@ class AutocheckoutManager {
// Causes the Autocheckout bubble to be displayed if the user hasn't seen it
// yet for the current page. |frame_url| is the page where Autocheckout is
- // being initiated. |ssl_status| is the SSL status of the page. |bounding_box|
- // is the bounding box of the input field in focus.
+ // being initiated. |bounding_box| is the bounding box of the input field in
+ // focus.
virtual void MaybeShowAutocheckoutBubble(const GURL& frame_url,
- const content::SSLStatus& ssl_status,
const gfx::RectF& bounding_box);
bool is_autocheckout_bubble_showing() const {
@@ -89,7 +84,6 @@ class AutocheckoutManager {
// Show the requestAutocomplete dialog if |show_dialog| is true. Also, does
// bookkeeping for whether or not the bubble is showing.
virtual void MaybeShowAutocheckoutDialog(const GURL& frame_url,
- const content::SSLStatus& ssl_status,
bool show_dialog);
// Callback called from AutofillDialogController on filling up the UI form.
@@ -101,11 +95,10 @@ class AutocheckoutManager {
private:
// Shows the Autocheckout bubble. Must be called on the UI thread. |frame_url|
- // is the page where Autocheckout is being initiated. |ssl_status| is the SSL
- // status of the page. |bounding_box| is the bounding box of the input field
- // in focus. |cookies| is any Google Account cookies.
+ // is the page where Autocheckout is being initiated. |bounding_box| is the
+ // bounding box of the input field in focus. |cookies| is any Google Account
+ // cookies.
void ShowAutocheckoutBubble(const GURL& frame_url,
- const content::SSLStatus& ssl_status,
const gfx::RectF& bounding_box,
const std::string& cookies);
diff --git a/components/autofill/content/browser/autocheckout_manager_unittest.cc b/components/autofill/content/browser/autocheckout_manager_unittest.cc
index b4f9b1b..76e9b1b 100644
--- a/components/autofill/content/browser/autocheckout_manager_unittest.cc
+++ b/components/autofill/content/browser/autocheckout_manager_unittest.cc
@@ -439,13 +439,10 @@ class AutocheckoutManagerTest : public ChromeRenderViewHostTestHarness {
autofill_manager_delegate_->SetUserSuppliedData(
FakeUserSubmittedFormStructure());
GURL frame_url;
- content::SSLStatus ssl_status;
EXPECT_CALL(autocheckout_manager_->metric_logger(),
LogAutocheckoutBuyFlowMetric(
AutofillMetrics::AUTOCHECKOUT_BUY_FLOW_STARTED)).Times(1);
- autocheckout_manager_->MaybeShowAutocheckoutDialog(frame_url,
- ssl_status,
- true);
+ autocheckout_manager_->MaybeShowAutocheckoutDialog(frame_url, true);
CheckFillFormsAndClickIpc();
EXPECT_TRUE(autocheckout_manager_->in_autocheckout_flow());
EXPECT_TRUE(autofill_manager_delegate_->request_autocomplete_dialog_open());
@@ -540,15 +537,12 @@ TEST_F(AutocheckoutManagerTest, TestFillForms) {
TEST_F(AutocheckoutManagerTest, OnFormsSeenTest) {
GURL frame_url;
- content::SSLStatus ssl_status;
gfx::RectF bounding_box;
EXPECT_CALL(autocheckout_manager_->metric_logger(),
LogAutocheckoutBubbleMetric(
AutofillMetrics::BUBBLE_COULD_BE_DISPLAYED)).Times(1);
autocheckout_manager_->OnLoadedPageMetaData(CreateStartOfFlowMetaData());
- autocheckout_manager_->MaybeShowAutocheckoutBubble(frame_url,
- ssl_status,
- bounding_box);
+ autocheckout_manager_->MaybeShowAutocheckoutBubble(frame_url, bounding_box);
content::RunAllPendingInMessageLoop(BrowserThread::IO);
EXPECT_TRUE(autocheckout_manager_->autocheckout_offered());
@@ -609,16 +603,13 @@ TEST_F(AutocheckoutManagerTest, OnClickFailedTestMissingClickAfterFilling) {
TEST_F(AutocheckoutManagerTest, MaybeShowAutocheckoutBubbleTest) {
GURL frame_url;
- content::SSLStatus ssl_status;
gfx::RectF bounding_box;
EXPECT_CALL(autocheckout_manager_->metric_logger(),
LogAutocheckoutBubbleMetric(
AutofillMetrics::BUBBLE_COULD_BE_DISPLAYED)).Times(1);
autocheckout_manager_->OnLoadedPageMetaData(CreateStartOfFlowMetaData());
// MaybeShowAutocheckoutBubble shows bubble if it has not been shown.
- autocheckout_manager_->MaybeShowAutocheckoutBubble(frame_url,
- ssl_status,
- bounding_box);
+ autocheckout_manager_->MaybeShowAutocheckoutBubble(frame_url, bounding_box);
content::RunAllPendingInMessageLoop(BrowserThread::IO);
EXPECT_TRUE(autocheckout_manager_->autocheckout_offered());
EXPECT_TRUE(autofill_manager_delegate_->autocheckout_bubble_shown());
@@ -629,9 +620,7 @@ TEST_F(AutocheckoutManagerTest, MaybeShowAutocheckoutBubbleTest) {
// MaybeShowAutocheckoutBubble does nothing if the bubble was already shown
// for the current page.
- autocheckout_manager_->MaybeShowAutocheckoutBubble(frame_url,
- ssl_status,
- bounding_box);
+ autocheckout_manager_->MaybeShowAutocheckoutBubble(frame_url, bounding_box);
content::RunAllPendingInMessageLoop(BrowserThread::IO);
EXPECT_TRUE(autocheckout_manager_->autocheckout_offered());
EXPECT_FALSE(autofill_manager_delegate_->autocheckout_bubble_shown());
@@ -796,16 +785,13 @@ TEST_F(AutocheckoutManagerTest, SinglePageFlow) {
autofill_manager_delegate_->SetUserSuppliedData(
FakeUserSubmittedFormStructure());
GURL frame_url;
- content::SSLStatus ssl_status;
EXPECT_CALL(autocheckout_manager_->metric_logger(),
LogAutocheckoutBuyFlowMetric(
AutofillMetrics::AUTOCHECKOUT_BUY_FLOW_STARTED)).Times(1);
EXPECT_CALL(autocheckout_manager_->metric_logger(),
LogAutocheckoutBuyFlowMetric(
AutofillMetrics::AUTOCHECKOUT_BUY_FLOW_SUCCESS)).Times(1);
- autocheckout_manager_->MaybeShowAutocheckoutDialog(frame_url,
- ssl_status,
- true);
+ autocheckout_manager_->MaybeShowAutocheckoutDialog(frame_url, true);
CheckFillFormsAndClickIpc();
EXPECT_FALSE(autocheckout_manager_->in_autocheckout_flow());
EXPECT_TRUE(autofill_manager_delegate_->request_autocomplete_dialog_open());
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc
index 5beed48..1860884 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -24,8 +24,10 @@
#include "components/autofill/core/common/web_element_descriptor.h"
#include "content/public/common/password_form.h"
#include "content/public/common/ssl_status.h"
+#include "content/public/common/url_constants.h"
#include "content/public/renderer/render_view.h"
#include "grit/component_strings.h"
+#include "net/cert/cert_status_flags.h"
#include "third_party/WebKit/public/platform/WebRect.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
#include "third_party/WebKit/public/web/WebDataSource.h"
@@ -311,9 +313,6 @@ void AutofillAgent::MaybeShowAutocheckoutBubble() {
if (!FindFormAndFieldForInputElement(element_, &form, &field, REQUIRE_NONE))
return;
- form.ssl_status = render_view()->GetSSLStatusOfFrame(
- element_.document().frame());
-
Send(new AutofillHostMsg_MaybeShowAutocheckoutBubble(
routing_id(),
form,
@@ -326,8 +325,13 @@ void AutofillAgent::DidChangeScrollOffset(WebKit::WebFrame*) {
void AutofillAgent::didRequestAutocomplete(WebKit::WebFrame* frame,
const WebFormElement& form) {
+ GURL url(frame->document().url());
+ content::SSLStatus ssl_status = render_view()->GetSSLStatusOfFrame(frame);
FormData form_data;
if (!in_flight_request_form_.isNull() ||
+ (url.SchemeIs(chrome::kHttpsScheme) &&
+ (net::IsCertStatusError(ssl_status.cert_status) ||
+ net::IsCertStatusMinorError(ssl_status.cert_status))) ||
!WebFormElementToFormData(form,
WebFormControlElement(),
REQUIRE_AUTOCOMPLETE,
@@ -344,13 +348,7 @@ void AutofillAgent::didRequestAutocomplete(WebKit::WebFrame* frame,
HideAutofillUi();
in_flight_request_form_ = form;
- // Add SSL Status in the formdata to let browser process alert user
- // appropriately using browser UI.
- form_data.ssl_status = render_view()->GetSSLStatusOfFrame(frame);
- Send(new AutofillHostMsg_RequestAutocomplete(
- routing_id(),
- form_data,
- frame->document().url()));
+ Send(new AutofillHostMsg_RequestAutocomplete(routing_id(), form_data, url));
}
void AutofillAgent::setIgnoreTextChanges(bool ignore) {
@@ -841,10 +839,6 @@ void AutofillAgent::QueryAutofillSuggestions(const WebInputElement& element,
data_list_icons,
data_list_unique_ids));
- // Add SSL Status in the formdata to let browser process alert user
- // appropriately using browser UI.
- form.ssl_status = render_view()->GetSSLStatusOfFrame(
- element.document().frame());
Send(new AutofillHostMsg_QueryFormFieldAutofill(routing_id(),
autofill_query_id_,
form,
diff --git a/components/autofill/core/DEPS b/components/autofill/core/DEPS
index 5049420..caaebde 100644
--- a/components/autofill/core/DEPS
+++ b/components/autofill/core/DEPS
@@ -6,6 +6,5 @@ include_rules = [
"!content/public/common/common_param_traits.h",
"!content/public/common/common_param_traits_macros.h",
"!content/public/common/password_form.h",
- "!content/public/common/ssl_status.h",
"!third_party/WebKit/public/web/WebFormElement.h",
]
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index a8f9184..a849365 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -842,10 +842,7 @@ void AutofillManager::OnMaybeShowAutocheckoutBubble(
if (!HasServerSpecifiedFieldTypes(*cached_form))
return;
- autocheckout_manager_.MaybeShowAutocheckoutBubble(
- form.origin,
- form.ssl_status,
- bounding_box);
+ autocheckout_manager_.MaybeShowAutocheckoutBubble(form.origin, bounding_box);
}
void AutofillManager::UploadFormData(const FormStructure& submitted_form) {
diff --git a/components/autofill/core/browser/autofill_manager.h b/components/autofill/core/browser/autofill_manager.h
index 0159240..409dc0c 100644
--- a/components/autofill/core/browser/autofill_manager.h
+++ b/components/autofill/core/browser/autofill_manager.h
@@ -29,7 +29,6 @@
#include "components/autofill/core/common/autocheckout_status.h"
#include "components/autofill/core/common/form_data.h"
#include "components/autofill/core/common/forms_seen_state.h"
-#include "content/public/common/ssl_status.h"
#include "third_party/WebKit/public/web/WebFormElement.h"
class GURL;
diff --git a/components/autofill/core/browser/autofill_manager_delegate.h b/components/autofill/core/browser/autofill_manager_delegate.h
index 0571bd8..13772ab 100644
--- a/components/autofill/core/browser/autofill_manager_delegate.h
+++ b/components/autofill/core/browser/autofill_manager_delegate.h
@@ -15,7 +15,6 @@
namespace content {
struct PasswordForm;
-struct SSLStatus;
}
namespace gfx {
diff --git a/components/autofill/core/common/autofill_messages.h b/components/autofill/core/common/autofill_messages.h
index d173e78..9d3b87d 100644
--- a/components/autofill/core/common/autofill_messages.h
+++ b/components/autofill/core/common/autofill_messages.h
@@ -18,7 +18,6 @@
#include "content/public/common/common_param_traits.h"
#include "content/public/common/common_param_traits_macros.h"
#include "content/public/common/password_form.h"
-#include "content/public/common/ssl_status.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
#include "third_party/WebKit/public/web/WebFormElement.h"
diff --git a/components/autofill/core/common/form_data.cc b/components/autofill/core/common/form_data.cc
index 2008e0c..e0c3c1c 100644
--- a/components/autofill/core/common/form_data.cc
+++ b/components/autofill/core/common/form_data.cc
@@ -18,21 +18,19 @@ FormData::FormData(const FormData& data)
origin(data.origin),
action(data.action),
user_submitted(data.user_submitted),
- fields(data.fields),
- ssl_status(data.ssl_status) {
+ fields(data.fields) {
}
FormData::~FormData() {
}
bool FormData::operator==(const FormData& form) const {
- return (name == form.name &&
- StringToLowerASCII(method) == StringToLowerASCII(form.method) &&
- origin == form.origin &&
- action == form.action &&
- user_submitted == form.user_submitted &&
- fields == form.fields &&
- ssl_status.Equals(form.ssl_status));
+ return name == form.name &&
+ StringToLowerASCII(method) == StringToLowerASCII(form.method) &&
+ origin == form.origin &&
+ action == form.action &&
+ user_submitted == form.user_submitted &&
+ fields == form.fields;
}
bool FormData::operator!=(const FormData& form) const {
diff --git a/components/autofill/core/common/form_data.h b/components/autofill/core/common/form_data.h
index 89d70bc7..202fb8d 100644
--- a/components/autofill/core/common/form_data.h
+++ b/components/autofill/core/common/form_data.h
@@ -9,7 +9,6 @@
#include "base/strings/string16.h"
#include "components/autofill/core/common/form_field_data.h"
-#include "content/public/common/ssl_status.h"
#include "url/gurl.h"
namespace autofill {
@@ -36,8 +35,6 @@ struct FormData {
bool user_submitted;
// A vector of all the input fields in the form.
std::vector<FormFieldData> fields;
- // SSL status of the frame contatining the form.
- content::SSLStatus ssl_status;
};
} // namespace autofill