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

Side by Side Diff: components/infobars/core/confirm_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: pkasting Created 5 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "components/infobars/core/confirm_infobar_delegate.h" 5 #include "components/infobars/core/confirm_infobar_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "components/infobars/core/infobar.h" 8 #include "components/infobars/core/infobar.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/strings/grit/ui_strings.h" 10 #include "ui/strings/grit/ui_strings.h"
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 bool ConfirmInfoBarDelegate::Cancel() { 40 bool ConfirmInfoBarDelegate::Cancel() {
41 return true; 41 return true;
42 } 42 }
43 43
44 base::string16 ConfirmInfoBarDelegate::GetLinkText() const { 44 base::string16 ConfirmInfoBarDelegate::GetLinkText() const {
45 return base::string16(); 45 return base::string16();
46 } 46 }
47 47
48 GURL ConfirmInfoBarDelegate::GetLinkURL() const {
49 return GURL();
50 }
51
48 bool ConfirmInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { 52 bool ConfirmInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
49 return true; 53 infobar()->owner()->OpenURL(GetLinkURL(), disposition);
54 return false;
50 } 55 }
51 56
52 ConfirmInfoBarDelegate::ConfirmInfoBarDelegate() 57 ConfirmInfoBarDelegate::ConfirmInfoBarDelegate()
53 : InfoBarDelegate() { 58 : InfoBarDelegate() {
54 } 59 }
55 60
56 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { 61 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
57 ConfirmInfoBarDelegate* confirm_delegate = 62 ConfirmInfoBarDelegate* confirm_delegate =
58 delegate->AsConfirmInfoBarDelegate(); 63 delegate->AsConfirmInfoBarDelegate();
59 return confirm_delegate && 64 return confirm_delegate &&
60 (confirm_delegate->GetMessageText() == GetMessageText()); 65 (confirm_delegate->GetMessageText() == GetMessageText());
61 } 66 }
62 67
63 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() { 68 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() {
64 return this; 69 return this;
65 } 70 }
OLDNEW
« no previous file with comments | « components/infobars/core/confirm_infobar_delegate.h ('k') | components/infobars/core/infobar_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698