Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Side by Side Diff: chrome/browser/tab_contents/tab_contents_ssl_helper.cc

Issue 7096016: Remove JS dialog dependency from content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: now a tc delegate Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" 5 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/certificate_viewer.h" 10 #include "chrome/browser/certificate_viewer.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return BUTTON_OK; 82 return BUTTON_OK;
83 } 83 }
84 84
85 string16 SSLCertAddedInfoBarDelegate::GetButtonLabel( 85 string16 SSLCertAddedInfoBarDelegate::GetButtonLabel(
86 InfoBarButton button) const { 86 InfoBarButton button) const {
87 DCHECK_EQ(BUTTON_OK, button); 87 DCHECK_EQ(BUTTON_OK, button);
88 return l10n_util::GetStringUTF16(IDS_ADD_CERT_SUCCESS_INFOBAR_BUTTON); 88 return l10n_util::GetStringUTF16(IDS_ADD_CERT_SUCCESS_INFOBAR_BUTTON);
89 } 89 }
90 90
91 bool SSLCertAddedInfoBarDelegate::Accept() { 91 bool SSLCertAddedInfoBarDelegate::Accept() {
92 ShowCertificateViewer(tab_contents_->GetMessageBoxRootWindow(), cert_); 92 ShowCertificateViewer(tab_contents_->GetDialogRootWindow(), cert_);
93 return false; // Hiding the infobar just as the dialog opens looks weird. 93 return false; // Hiding the infobar just as the dialog opens looks weird.
94 } 94 }
95 95
96 } // namespace 96 } // namespace
97 97
98 98
99 // TabContentsSSLHelper::SSLAddCertData --------------------------------------- 99 // TabContentsSSLHelper::SSLAddCertData ---------------------------------------
100 100
101 class TabContentsSSLHelper::SSLAddCertData : public NotificationObserver { 101 class TabContentsSSLHelper::SSLAddCertData : public NotificationObserver {
102 public: 102 public:
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 TabContentsSSLHelper::SSLAddCertData* TabContentsSSLHelper::GetAddCertData( 224 TabContentsSSLHelper::SSLAddCertData* TabContentsSSLHelper::GetAddCertData(
225 SSLAddCertHandler* handler) { 225 SSLAddCertHandler* handler) {
226 // Find/create the slot. 226 // Find/create the slot.
227 linked_ptr<SSLAddCertData>& ptr_ref = 227 linked_ptr<SSLAddCertData>& ptr_ref =
228 request_id_to_add_cert_data_[handler->network_request_id()]; 228 request_id_to_add_cert_data_[handler->network_request_id()];
229 // Fill it if necessary. 229 // Fill it if necessary.
230 if (!ptr_ref.get()) 230 if (!ptr_ref.get())
231 ptr_ref.reset(new SSLAddCertData(tab_contents_)); 231 ptr_ref.reset(new SSLAddCertData(tab_contents_));
232 return ptr_ref.get(); 232 return ptr_ref.get();
233 } 233 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698