~osomon/oxide/camera-names-i18n

« back to all changes in this revision

Viewing changes to shared/browser/ssl/oxide_certificate_error.cc

  • Committer: Chris Coulson
  • Date: 2016-04-20 16:54:36 UTC
  • Revision ID: chris.coulson@canonical.com-20160420165436-4dpm7x985qytm8fl
CertificateErrorDispatcherClient only has a single method, so just convert it in to a callback. In addition to that, add thorough unit tests for CertificateErrorDispatcher

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
                                               proxy.get()));
112
112
}
113
113
 
 
114
// static
 
115
std::unique_ptr<CertificateError>
 
116
CertificateError::CreateForTestingWithPlaceholder(
 
117
    content::WebContents* contents,
 
118
    bool is_main_frame,
 
119
    bool is_subresource,
 
120
    CertError cert_error,
 
121
    net::X509Certificate* cert,
 
122
    const GURL& url,
 
123
    bool strict_enforcement,
 
124
    bool overridable,
 
125
    const base::Callback<void(bool)>& callback) {
 
126
  scoped_refptr<CertificateErrorProxy> proxy(
 
127
      new CertificateErrorProxy(callback));
 
128
  proxy->AttachPlaceholderPage(contents, url);
 
129
  return base::WrapUnique(new CertificateError(is_main_frame,
 
130
                                               is_subresource,
 
131
                                               cert_error,
 
132
                                               cert,
 
133
                                               url,
 
134
                                               strict_enforcement,
 
135
                                               overridable,
 
136
                                               proxy.get()));
 
137
}
 
138
 
114
139
void CertificateError::SimulateCancel() {
115
140
  proxy_->Cancel();
116
141
}