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

Side by Side Diff: chrome/browser/tab_contents/insecure_content_infobar_delegate.h

Issue 10843071: Create chrome/browser/api directory. Move infobar delegates used by Autofill to the directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 4 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_TAB_CONTENTS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_TAB_CONTENTS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_
7
8 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
9
10 // Base class for delegates that show warnings on HTTPS pages which try to
11 // display or run insecure content.
12 class InsecureContentInfoBarDelegate : public ConfirmInfoBarDelegate {
13 public:
14 enum InfoBarType {
15 DISPLAY, // Shown when "inactive" content (e.g. images) has been blocked.
16 RUN, // Shown when "active" content (e.g. script) has been blocked.
17 };
18
19 InsecureContentInfoBarDelegate(InfoBarTabHelper* infobar_helper,
20 InfoBarType type);
21 virtual ~InsecureContentInfoBarDelegate();
22
23 InfoBarType type() const { return type_; }
24
25 private:
26 enum HistogramEvents {
27 DISPLAY_INFOBAR_SHOWN = 0, // Infobar was displayed.
28 DISPLAY_USER_OVERRIDE, // User clicked allow anyway button.
29 DISPLAY_USER_DID_NOT_LOAD, // User clicked the don't load button.
30 DISPLAY_INFOBAR_DISMISSED, // User clicked close button.
31 RUN_INFOBAR_SHOWN,
32 RUN_USER_OVERRIDE,
33 RUN_USER_DID_NOT_LOAD,
34 RUN_INFOBAR_DISMISSED,
35 NUM_EVENTS
36 };
37
38 // ConfirmInfoBarDelegate:
39 virtual void InfoBarDismissed() OVERRIDE;
40 virtual InsecureContentInfoBarDelegate*
41 AsInsecureContentInfoBarDelegate() OVERRIDE;
42 virtual string16 GetMessageText() const OVERRIDE;
43 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
44 virtual bool Accept() OVERRIDE;
45 virtual bool Cancel() OVERRIDE;
46 virtual string16 GetLinkText() const OVERRIDE;
47 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
48
49 InfoBarType type_;
50
51 DISALLOW_IMPLICIT_CONSTRUCTORS(InsecureContentInfoBarDelegate);
52 };
53
54 #endif // CHROME_BROWSER_TAB_CONTENTS_INSECURE_CONTENT_INFOBAR_DELEGATE_H_
55
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698