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

Side by Side Diff: chrome/browser/page_info_model.h

Issue 3136031: Part 2 of the SSL InfoBubble.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/app/theme/pageinfo_good.png ('k') | chrome/browser/page_info_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_PAGE_INFO_MODEL_H_ 5 #ifndef CHROME_BROWSER_PAGE_INFO_MODEL_H_
6 #define CHROME_BROWSER_PAGE_INFO_MODEL_H_ 6 #define CHROME_BROWSER_PAGE_INFO_MODEL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "chrome/browser/cancelable_request.h" 12 #include "chrome/browser/cancelable_request.h"
13 #include "chrome/browser/history/history.h" 13 #include "chrome/browser/history/history.h"
14 #include "chrome/browser/tab_contents/navigation_entry.h" 14 #include "chrome/browser/tab_contents/navigation_entry.h"
15 #include "googleurl/src/gurl.h" 15 #include "googleurl/src/gurl.h"
16 16
17 class PrefService; 17 class PrefService;
18 class Profile; 18 class Profile;
19 19
20 // The model that provides the information that should be displayed in the page 20 // The model that provides the information that should be displayed in the page
21 // info dialog. 21 // info dialog/bubble.
22 class PageInfoModel { 22 class PageInfoModel {
23 public: 23 public:
24 class PageInfoModelObserver { 24 class PageInfoModelObserver {
25 public: 25 public:
26 virtual void ModelChanged() = 0; 26 virtual void ModelChanged() = 0;
27 27
28 protected: 28 protected:
29 virtual ~PageInfoModelObserver() {} 29 virtual ~PageInfoModelObserver() {}
30 }; 30 };
31 31
32 enum SectionInfoType {
33 SECTION_INFO_IDENTITY = 0,
34 SECTION_INFO_CONNECTION,
35 SECTION_INFO_FIRST_VISIT,
36 };
37
32 struct SectionInfo { 38 struct SectionInfo {
33 SectionInfo(bool state, 39 SectionInfo(bool state,
34 const string16& title, 40 const string16& title,
35 const string16& head_line, 41 const string16& headline,
36 const string16& description) 42 const string16& description,
43 SectionInfoType type)
37 : state(state), 44 : state(state),
38 title(title), 45 title(title),
39 head_line(head_line), 46 headline(headline),
40 description(description) { 47 description(description),
48 type(type) {
41 } 49 }
42 50
43 bool state; // True if state is OK, false otherwise (ex of bad states: 51 bool state; // True if state is OK, false otherwise (ex of bad states:
44 // unverified identity over HTTPS). 52 // unverified identity over HTTPS).
45 53
46 // The title of the section. 54 // The title of the section.
47 string16 title; 55 string16 title;
48 56
49 // A single line describing the section, optional. 57 // A single line describing the section, optional.
50 string16 head_line; 58 string16 headline;
51 59
52 // The full description of what this section is. 60 // The full description of what this section is.
53 string16 description; 61 string16 description;
62
63 // The type of SectionInfo we are dealing with, for example: Identity,
64 // Connection, First Visit.
65 SectionInfoType type;
54 }; 66 };
55 67
56 PageInfoModel(Profile* profile, 68 PageInfoModel(Profile* profile,
57 const GURL& url, 69 const GURL& url,
58 const NavigationEntry::SSLStatus& ssl, 70 const NavigationEntry::SSLStatus& ssl,
59 bool show_history, 71 bool show_history,
60 PageInfoModelObserver* observer); 72 PageInfoModelObserver* observer);
61 73
62 int GetSectionCount(); 74 int GetSectionCount();
63 SectionInfo GetSectionInfo(int index); 75 SectionInfo GetSectionInfo(int index);
(...skipping 15 matching lines...) Expand all
79 std::vector<SectionInfo> sections_; 91 std::vector<SectionInfo> sections_;
80 92
81 // Used to request number of visits. 93 // Used to request number of visits.
82 CancelableRequestConsumer request_consumer_; 94 CancelableRequestConsumer request_consumer_;
83 95
84 private: 96 private:
85 DISALLOW_COPY_AND_ASSIGN(PageInfoModel); 97 DISALLOW_COPY_AND_ASSIGN(PageInfoModel);
86 }; 98 };
87 99
88 #endif // CHROME_BROWSER_PAGE_INFO_MODEL_H_ 100 #endif // CHROME_BROWSER_PAGE_INFO_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/app/theme/pageinfo_good.png ('k') | chrome/browser/page_info_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698