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

Side by Side Diff: chrome/browser/media/protected_media_identifier_infobar_delegate.cc

Issue 1361253002: Separate the URL of an infobar link with clicking on it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fit Created 5 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/media/protected_media_identifier_infobar_delegate.h" 5 #include "chrome/browser/media/protected_media_identifier_infobar_delegate.h"
6 6
7 #include "chrome/browser/infobars/infobar_service.h" 7 #include "chrome/browser/infobars/infobar_service.h"
8 #include "chrome/common/url_constants.h" 8 #include "chrome/common/url_constants.h"
9 #include "chrome/grit/generated_resources.h" 9 #include "chrome/grit/generated_resources.h"
10 #include "components/infobars/core/infobar.h" 10 #include "components/infobars/core/infobar.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 return l10n_util::GetStringFUTF16( 50 return l10n_util::GetStringFUTF16(
51 IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION, 51 IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION,
52 url_formatter::FormatUrl(requesting_frame_.GetOrigin(), 52 url_formatter::FormatUrl(requesting_frame_.GetOrigin(),
53 display_languages_)); 53 display_languages_));
54 } 54 }
55 55
56 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetLinkText() const { 56 base::string16 ProtectedMediaIdentifierInfoBarDelegate::GetLinkText() const {
57 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); 57 return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
58 } 58 }
59 59
60 GURL ProtectedMediaIdentifierInfoBarDelegate::GetLinkURL() const {
61 return GURL(chrome::kEnhancedPlaybackNotificationLearnMoreURL);
62 }
63
60 bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked( 64 bool ProtectedMediaIdentifierInfoBarDelegate::LinkClicked(
61 WindowOpenDisposition disposition) { 65 WindowOpenDisposition disposition) {
62 InfoBarService::WebContentsFromInfoBar(infobar()) 66 InfoBarService::WebContentsFromInfoBar(infobar())
63 ->OpenURL(content::OpenURLParams( 67 ->OpenURL(content::OpenURLParams(
64 GURL(chrome::kEnhancedPlaybackNotificationLearnMoreURL), 68 GetLinkURL(),
65 content::Referrer(), 69 content::Referrer(),
66 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 70 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
67 ui::PAGE_TRANSITION_LINK, false)); 71 ui::PAGE_TRANSITION_LINK, false));
68 return false; // Do not dismiss the info bar. 72 return false; // Do not dismiss the info bar.
69 } 73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698