summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl_manager.cc
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-14 16:42:25 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-14 16:42:25 +0000
commit807bfceada33743cad3308af48c538d7d7515495 (patch)
tree19953eac8d00695cfbb8c00137d8eb192e0aedc7 /chrome/browser/ssl_manager.cc
parent7b7965f2391594e6a3944ffee8fcdaaf18683fc3 (diff)
downloadchromium_src-807bfceada33743cad3308af48c538d7d7515495.zip
chromium_src-807bfceada33743cad3308af48c538d7d7515495.tar.gz
chromium_src-807bfceada33743cad3308af48c538d7d7515495.tar.bz2
Move more view stuff out of WebContents. This moves context menus and info
bars. I removed the associated functions on TabContents, and have callers call directly through to the view when the care about mucking with the info bar (which is busted, IMO). Review URL: http://codereview.chromium.org/7245 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl_manager.cc')
-rw-r--r--chrome/browser/ssl_manager.cc40
1 files changed, 22 insertions, 18 deletions
diff --git a/chrome/browser/ssl_manager.cc b/chrome/browser/ssl_manager.cc
index 4575e5f..d30dfc3 100644
--- a/chrome/browser/ssl_manager.cc
+++ b/chrome/browser/ssl_manager.cc
@@ -19,9 +19,10 @@
#include "chrome/browser/ssl_policy.h"
#include "chrome/browser/tab_contents.h"
#include "chrome/browser/tab_util.h"
-#include "chrome/browser/web_contents.h"
#include "chrome/browser/views/info_bar_view.h"
#include "chrome/browser/views/standard_layout.h"
+#include "chrome/browser/web_contents.h"
+#include "chrome/browser/web_contents_view.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
@@ -148,27 +149,30 @@ void SSLManager::ShowMessageWithLink(const std::wstring& msg,
if (entry->ssl().security_style() <= SECURITY_STYLE_UNAUTHENTICATED)
return;
- InfoBarView* info_bar_view =
- controller_->active_contents()->GetInfoBarView();
- DCHECK(info_bar_view);
-
- if (!info_bar_view)
- return;
+ // TODO(brettw) have a more general way to deal with info bars.
+ if (controller_->active_contents()->AsWebContents()) {
+ InfoBarView* info_bar_view = controller_->active_contents()->
+ AsWebContents()->view()->GetInfoBarView();
+ DCHECK(info_bar_view);
- // Check if we are already displaying this message.
- ObserverList<SSLInfoBar>::Iterator it(visible_info_bars_);
- SSLInfoBar* info_bar;
- while (info_bar = it.GetNext()) {
- if (info_bar->GetMessageText() == msg)
+ if (!info_bar_view)
return;
- }
- // Show the message.
- info_bar = new SSLInfoBar(this, msg, link_text, task);
- visible_info_bars_.AddObserver(info_bar);
+ // Check if we are already displaying this message.
+ ObserverList<SSLInfoBar>::Iterator it(visible_info_bars_);
+ SSLInfoBar* info_bar;
+ while (info_bar = it.GetNext()) {
+ if (info_bar->GetMessageText() == msg)
+ return;
+ }
+
+ // Show the message.
+ info_bar = new SSLInfoBar(this, msg, link_text, task);
+ visible_info_bars_.AddObserver(info_bar);
- // false indicates info_bar is not automatically removed.
- info_bar_view->AppendInfoBarItem(info_bar, false);
+ // false indicates info_bar is not automatically removed.
+ info_bar_view->AppendInfoBarItem(info_bar, false);
+ }
}
// Delegate API method.