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

Side by Side Diff: chrome/browser/api/infobars/link_infobar_delegate.h

Issue 11721003: Eliminate the LinkInfoBar[Delegate] classes entirely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address some nits - testing-automation matters? Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_API_INFOBARS_LINK_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_API_INFOBARS_LINK_INFOBAR_DELEGATE_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/string16.h"
11 #include "chrome/browser/api/infobars/infobar_delegate.h"
12
13 // An interface derived from InfoBarDelegate implemented by objects wishing to
14 // control a LinkInfoBar.
15 class LinkInfoBarDelegate : public InfoBarDelegate {
16 public:
17 // Returns the message string to be displayed in the InfoBar. |link_offset|
18 // is the position where the link should be inserted.
19 virtual string16 GetMessageTextWithOffset(size_t* link_offset) const = 0;
20
21 // Returns the text of the link to be displayed.
22 virtual string16 GetLinkText() const = 0;
23
24 // Called when the Link is clicked. The |disposition| specifies how the
25 // resulting document should be loaded (based on the event flags present when
26 // the link was clicked). If this function returns true, the infobar is then
27 // immediately closed. Subclasses MUST NOT return true if in handling this
28 // call something triggers the infobar to begin closing.
29 virtual bool LinkClicked(WindowOpenDisposition disposition);
30
31 protected:
32 explicit LinkInfoBarDelegate(InfoBarService* infobar_service);
33 virtual ~LinkInfoBarDelegate();
34
35 private:
36 // InfoBarDelegate:
37 virtual InfoBar* CreateInfoBar(InfoBarService* infobar_service) OVERRIDE;
38 virtual LinkInfoBarDelegate* AsLinkInfoBarDelegate() OVERRIDE;
39
40 DISALLOW_COPY_AND_ASSIGN(LinkInfoBarDelegate);
41 };
42
43 #endif // CHROME_BROWSER_API_INFOBARS_LINK_INFOBAR_DELEGATE_H_
44
OLDNEW
« no previous file with comments | « chrome/browser/api/infobars/infobar_delegate.cc ('k') | chrome/browser/api/infobars/link_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698