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

Unified Diff: components/infobars/core/confirm_infobar_delegate.h

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: ios 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 side-by-side diff with in-line comments
Download patch
Index: components/infobars/core/confirm_infobar_delegate.h
diff --git a/components/infobars/core/confirm_infobar_delegate.h b/components/infobars/core/confirm_infobar_delegate.h
index d36ea224a272009f16eb86c784a12442358af7fc..39dd8e7fcf2663cae72f222bf6677639ce890c73 100644
--- a/components/infobars/core/confirm_infobar_delegate.h
+++ b/components/infobars/core/confirm_infobar_delegate.h
@@ -9,6 +9,7 @@
#include "base/strings/string16.h"
#include "components/infobars/core/infobar_delegate.h"
#include "components/infobars/core/infobar_manager.h"
+#include "url/gurl.h"
namespace infobars {
class InfoBar;
@@ -55,14 +56,20 @@ class ConfirmInfoBarDelegate : public infobars::InfoBarDelegate {
virtual bool Cancel();
// Returns the text of the link to be displayed, if any. Otherwise returns
- // and empty string.
+ // an empty string.
virtual base::string16 GetLinkText() const;
- // Called when the Link (if any) is clicked. The |disposition| specifies how
- // the resulting document should be loaded (based on the event flags present
- // when the link was clicked). If this function returns true, the infobar is
- // then immediately closed. Subclasses MUST NOT return true if in handling
- // this call something triggers the infobar to begin closing.
+ // Returns the URL of the link to be displayed.
+ virtual GURL GetLinkURL() const;
+
+ // Called when the link (if any) is clicked; if this function returns true,
+ // the infobar is then immediately closed. The default implementation opens
+ // the URL returned by GetLinkURL(), above, and returns false.
+ //
+ // The |disposition| specifies how the resulting document should be loaded
+ // (based on the event flags present when the link was clicked). Subclasses
+ // MUST NOT return true if in handling this call something triggers the
+ // infobar to begin closing.
Peter Kasting 2015/10/01 00:10:58 Nit: Move this last sentence to end of the previou
Avi (use Gerrit) 2015/10/01 00:20:33 Done.
Peter Kasting 2015/10/01 00:23:54 Oh, my mistake. Put the comment on the InfoBarSer
Avi (use Gerrit) 2015/10/01 00:25:38 My latest patchset puts a comment in InfoBarServic
Peter Kasting 2015/10/01 01:20:22 I don't tend to be hard-and-fast about this one, b
virtual bool LinkClicked(WindowOpenDisposition disposition);
protected:

Powered by Google App Engine
This is Rietveld 408576698