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

Side by Side Diff: trunk/src/chrome/browser/infobars/insecure_content_infobar_delegate.h

Issue 102163002: Revert 238283 "Infobar system refactor." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROME_BROWSER_INFOBARS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_INFOBARS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_INFOBARS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_INFOBARS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_
7 7
8 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 8 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
9 9
10 // Base class for delegates that show warnings on HTTPS pages which try to 10 // Base class for delegates that show warnings on HTTPS pages which try to
11 // display or run insecure content. 11 // display or run insecure content.
12 class InsecureContentInfoBarDelegate : public ConfirmInfoBarDelegate { 12 class InsecureContentInfoBarDelegate : public ConfirmInfoBarDelegate {
13 public: 13 public:
14 enum InfoBarType { 14 enum InfoBarType {
15 DISPLAY, // Shown when "inactive" content (e.g. images) has been blocked. 15 DISPLAY, // Shown when "inactive" content (e.g. images) has been blocked.
16 RUN, // Shown when "active" content (e.g. script) has been blocked. 16 RUN, // Shown when "active" content (e.g. script) has been blocked.
17 }; 17 };
18 18
19 // Depending on the |type| requested and whether an insecure content infobar 19 // Depending on the |type| requested and whether an insecure content infobar
20 // is already present in |infobar_service|, may do nothing; otherwise, creates 20 // is already present in |infobar_service|, may do nothing; otherwise, creates
21 // an insecure content infobar and delegate and either adds the infobar to 21 // an insecure content infobar delegate and either adds it to
22 // |infobar_service| or replaces the existing infobar. 22 // |infobar_service| or replaces the existing infobar.
23 static void Create(InfoBarService* infobar_service, InfoBarType type); 23 static void Create(InfoBarService* infobar_service, InfoBarType type);
24 24
25 private: 25 private:
26 enum HistogramEvents { 26 enum HistogramEvents {
27 DISPLAY_INFOBAR_SHOWN = 0, // Infobar was displayed. 27 DISPLAY_INFOBAR_SHOWN = 0, // Infobar was displayed.
28 DISPLAY_USER_OVERRIDE, // User clicked allow anyway button. 28 DISPLAY_USER_OVERRIDE, // User clicked allow anyway button.
29 DISPLAY_USER_DID_NOT_LOAD, // User clicked the don't load button. 29 DISPLAY_USER_DID_NOT_LOAD, // User clicked the don't load button.
30 DISPLAY_INFOBAR_DISMISSED, // User clicked close button. 30 DISPLAY_INFOBAR_DISMISSED, // User clicked close button.
31 RUN_INFOBAR_SHOWN, 31 RUN_INFOBAR_SHOWN,
32 RUN_USER_OVERRIDE, 32 RUN_USER_OVERRIDE,
33 RUN_USER_DID_NOT_LOAD, 33 RUN_USER_DID_NOT_LOAD,
34 RUN_INFOBAR_DISMISSED, 34 RUN_INFOBAR_DISMISSED,
35 NUM_EVENTS 35 NUM_EVENTS
36 }; 36 };
37 37
38 explicit InsecureContentInfoBarDelegate(InfoBarType type); 38 InsecureContentInfoBarDelegate(InfoBarService* infobar_service,
39 InfoBarType type);
39 virtual ~InsecureContentInfoBarDelegate(); 40 virtual ~InsecureContentInfoBarDelegate();
40 41
41 // ConfirmInfoBarDelegate: 42 // ConfirmInfoBarDelegate:
42 virtual void InfoBarDismissed() OVERRIDE; 43 virtual void InfoBarDismissed() OVERRIDE;
43 virtual InsecureContentInfoBarDelegate* 44 virtual InsecureContentInfoBarDelegate*
44 AsInsecureContentInfoBarDelegate() OVERRIDE; 45 AsInsecureContentInfoBarDelegate() OVERRIDE;
45 virtual string16 GetMessageText() const OVERRIDE; 46 virtual string16 GetMessageText() const OVERRIDE;
46 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; 47 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
47 virtual bool Accept() OVERRIDE; 48 virtual bool Accept() OVERRIDE;
48 virtual bool Cancel() OVERRIDE; 49 virtual bool Cancel() OVERRIDE;
49 virtual string16 GetLinkText() const OVERRIDE; 50 virtual string16 GetLinkText() const OVERRIDE;
50 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; 51 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
51 52
52 InfoBarType type_; 53 InfoBarType type_;
53 54
54 DISALLOW_IMPLICIT_CONSTRUCTORS(InsecureContentInfoBarDelegate); 55 DISALLOW_IMPLICIT_CONSTRUCTORS(InsecureContentInfoBarDelegate);
55 }; 56 };
56 57
57 #endif // CHROME_BROWSER_INFOBARS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_ 58 #endif // CHROME_BROWSER_INFOBARS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_
58 59
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698