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

Unified Diff: chrome/browser/media/protected_media_identifier_infobar_delegate.cc

Issue 1142153002: Simplify infobar expiry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android compile Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/protected_media_identifier_infobar_delegate.cc
diff --git a/chrome/browser/media/protected_media_identifier_infobar_delegate.cc b/chrome/browser/media/protected_media_identifier_infobar_delegate.cc
index deb24c103e475757c74aa00c5cc8b441e5e2c062..c15596882920340a901845af14ea2a81fa162c15 100644
--- a/chrome/browser/media/protected_media_identifier_infobar_delegate.cc
+++ b/chrome/browser/media/protected_media_identifier_infobar_delegate.cc
@@ -9,7 +9,6 @@
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/infobars/core/infobar.h"
-#include "content/public/browser/navigation_entry.h"
#include "grit/components_strings.h"
#include "grit/theme_resources.h"
#include "net/base/net_util.h"
@@ -22,14 +21,10 @@ infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegate::Create(
const PermissionRequestID& id,
const GURL& requesting_frame,
const std::string& display_languages) {
- const content::NavigationEntry* committed_entry =
- infobar_service->web_contents()->GetController().GetLastCommittedEntry();
return infobar_service->AddInfoBar(
infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>(
new ProtectedMediaIdentifierInfoBarDelegate(
- controller, id, requesting_frame,
- committed_entry ? committed_entry->GetUniqueID() : 0,
- display_languages))));
+ controller, id, requesting_frame, display_languages))));
}
@@ -38,13 +33,11 @@ ProtectedMediaIdentifierInfoBarDelegate::
PermissionQueueController* controller,
const PermissionRequestID& id,
const GURL& requesting_frame,
- int contents_unique_id,
const std::string& display_languages)
: ConfirmInfoBarDelegate(),
controller_(controller),
id_(id),
requesting_frame_(requesting_frame),
- contents_unique_id_(contents_unique_id),
display_languages_(display_languages) {
}
@@ -80,14 +73,6 @@ void ProtectedMediaIdentifierInfoBarDelegate::InfoBarDismissed() {
SetPermission(false, false);
}
-bool ProtectedMediaIdentifierInfoBarDelegate::ShouldExpireInternal(
- const NavigationDetails& details) const {
- // This implementation matches InfoBarDelegate::ShouldExpireInternal(), but
- // uses the unique ID we set in the constructor instead of that stored in the
- // base class.
- return (contents_unique_id_ != details.entry_id) || details.is_reload;
-}
-
base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetMessageText() const {
return l10n_util::GetStringFUTF16(
IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION,
@@ -112,10 +97,10 @@ base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetLinkText() const {
bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
- const GURL learn_more_url(chrome::kEnhancedPlaybackNotificationLearnMoreURL);
InfoBarService::WebContentsFromInfoBar(infobar())
->OpenURL(content::OpenURLParams(
- learn_more_url, content::Referrer(),
+ GURL(chrome::kEnhancedPlaybackNotificationLearnMoreURL),
+ content::Referrer(),
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
ui::PAGE_TRANSITION_LINK, false));
return false; // Do not dismiss the info bar.

Powered by Google App Engine
This is Rietveld 408576698