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

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: pkasting 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..82f73364db7fac00571b9e2c6cb562655654ebc6 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. Subclasses MUST
+ // NOT return true if in handling this call something triggers the infobar to
+ // begin closing.
+ //
+ // The |disposition| specifies how the resulting document should be loaded
+ // (based on the event flags present when the link was clicked).
virtual bool LinkClicked(WindowOpenDisposition disposition);
protected:
« no previous file with comments | « components/autofill/core/browser/test_autofill_client.cc ('k') | components/infobars/core/confirm_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698