| OLD | NEW |
| 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/blocked_infobar_delegate.h" | 5 #include "chrome/browser/tab_contents/blocked_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 BlockedInfoBarDelegate* BlockedInfoBarDelegate::AsBlockedInfoBarDelegate() { | 43 BlockedInfoBarDelegate* BlockedInfoBarDelegate::AsBlockedInfoBarDelegate() { |
| 44 return this; | 44 return this; |
| 45 } | 45 } |
| 46 | 46 |
| 47 string16 BlockedInfoBarDelegate::GetMessageText() const { | 47 string16 BlockedInfoBarDelegate::GetMessageText() const { |
| 48 return l10n_util::GetStringUTF16(message_resource_id_); | 48 return l10n_util::GetStringUTF16(message_resource_id_); |
| 49 } | 49 } |
| 50 | 50 |
| 51 int BlockedInfoBarDelegate::GetButtons() const { | 51 int BlockedInfoBarDelegate::GetButtons() const { |
| 52 return BUTTON_OK; | 52 return BUTTON_OK | BUTTON_CANCEL; |
| 53 } | 53 } |
| 54 | 54 |
| 55 string16 BlockedInfoBarDelegate::GetButtonLabel(InfoBarButton button) const { | 55 string16 BlockedInfoBarDelegate::GetButtonLabel(InfoBarButton button) const { |
| 56 if (button == BUTTON_CANCEL) |
| 57 return l10n_util::GetStringUTF16(IDS_OK); |
| 58 |
| 56 DCHECK_EQ(button, BUTTON_OK); | 59 DCHECK_EQ(button, BUTTON_OK); |
| 57 return l10n_util::GetStringUTF16(button_resource_id_); | 60 return l10n_util::GetStringUTF16(button_resource_id_); |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 string16 BlockedInfoBarDelegate::GetLinkText() { | 63 string16 BlockedInfoBarDelegate::GetLinkText() { |
| 61 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 64 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
| 62 } | 65 } |
| 63 | 66 |
| 64 bool BlockedInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { | 67 bool BlockedInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
| 65 TabContents* contents = wrapper_->tab_contents(); | 68 TabContents* contents = wrapper_->tab_contents(); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 129 |
| 127 bool BlockedRunningInfoBarDelegate::Accept() { | 130 bool BlockedRunningInfoBarDelegate::Accept() { |
| 128 UMA_HISTOGRAM_ENUMERATION("MixedContent.RunningInfoBar", | 131 UMA_HISTOGRAM_ENUMERATION("MixedContent.RunningInfoBar", |
| 129 BLOCKED_INFOBAR_EVENT_ALLOWED, | 132 BLOCKED_INFOBAR_EVENT_ALLOWED, |
| 130 BLOCKED_INFOBAR_EVENT_LAST); | 133 BLOCKED_INFOBAR_EVENT_LAST); |
| 131 wrapper()->Send(new ViewMsg_SetAllowRunningInsecureContent( | 134 wrapper()->Send(new ViewMsg_SetAllowRunningInsecureContent( |
| 132 wrapper()->routing_id(), true)); | 135 wrapper()->routing_id(), true)); |
| 133 return true; | 136 return true; |
| 134 } | 137 } |
| 135 | 138 |
| OLD | NEW |