| Index: chrome/browser/page_info_model.h
|
| diff --git a/chrome/browser/page_info_model.h b/chrome/browser/page_info_model.h
|
| index 77ba6149ecd3c45a73dafae57dd5d02c30c9b7ed..04a7a2df29b439e28f56a2621b4b41cc7f01c1a1 100644
|
| --- a/chrome/browser/page_info_model.h
|
| +++ b/chrome/browser/page_info_model.h
|
| @@ -14,8 +14,18 @@
|
| #include "chrome/browser/tab_contents/navigation_entry.h"
|
| #include "googleurl/src/gurl.h"
|
|
|
| +#ifdef __OBJC__
|
| +@class NSImage;
|
| +#else
|
| +class NSImage;
|
| +#endif // __OBJC__
|
| class PrefService;
|
| class Profile;
|
| +class SkBitmap;
|
| +
|
| +#if defined(USE_X11) && !defined(TOOLKIT_VIEWS)
|
| +typedef struct _GdkPixbuf GdkPixbuf;
|
| +#endif
|
|
|
| // The model that provides the information that should be displayed in the page
|
| // info dialog/bubble.
|
| @@ -34,23 +44,37 @@ class PageInfoModel {
|
| SECTION_INFO_FIRST_VISIT,
|
| };
|
|
|
| - enum SectionInfoState {
|
| - SECTION_STATE_OK = 0,
|
| + // TODO(rsesek): Extract this information out to gfx::NativeImage.
|
| +#if defined(OS_MACOSX)
|
| + typedef NSImage* ImageType;
|
| +#elif defined(USE_X11) && !defined(TOOLKIT_VIEWS)
|
| + typedef GdkPixbuf* ImageType;
|
| +#else
|
| + typedef const SkBitmap* ImageType;
|
| +#endif
|
| +
|
| + enum SectionStateIcon {
|
| + // No icon.
|
| + ICON_NONE = -1,
|
| + // State is OK.
|
| + ICON_STATE_OK,
|
| // For example, if state is OK but contains mixed content.
|
| - SECTION_STATE_WARNING_MINOR,
|
| + ICON_STATE_WARNING_MINOR,
|
| // For example, if content was served over HTTP.
|
| - SECTION_STATE_WARNING_MAJOR,
|
| + ICON_STATE_WARNING_MAJOR,
|
| // For example, unverified identity over HTTPS.
|
| - SECTION_STATE_ERROR,
|
| + ICON_STATE_ERROR,
|
| + // An information icon.
|
| + ICON_STATE_INFO
|
| };
|
|
|
| struct SectionInfo {
|
| - SectionInfo(SectionInfoState state,
|
| + SectionInfo(SectionStateIcon icon_id,
|
| const string16& title,
|
| const string16& headline,
|
| const string16& description,
|
| SectionInfoType type)
|
| - : state(state),
|
| + : icon_id(icon_id),
|
| title(title),
|
| headline(headline),
|
| description(description),
|
| @@ -58,7 +82,7 @@ class PageInfoModel {
|
| }
|
|
|
| // The overall state of the connection (error, warning, ok).
|
| - SectionInfoState state;
|
| + SectionStateIcon icon_id;
|
|
|
| // The title of the section.
|
| string16 title;
|
| @@ -84,6 +108,9 @@ class PageInfoModel {
|
| int GetSectionCount();
|
| SectionInfo GetSectionInfo(int index);
|
|
|
| + // Returns the native image type for an icon with the given id.
|
| + ImageType GetIconImage(SectionStateIcon icon_id);
|
| +
|
| // Callback from history service with number of visits to url.
|
| void OnGotVisitCountToHost(HistoryService::Handle handle,
|
| bool found_visits,
|
| @@ -96,10 +123,21 @@ class PageInfoModel {
|
| // Testing constructor. DO NOT USE.
|
| PageInfoModel();
|
|
|
| + // Shared initialization for default and testing constructor.
|
| + void Init();
|
| +
|
| + // Gets the native image resource of the given id from the ResourceBundle.
|
| + // Mac only: image is owned by caller. On other platforms, the image is owned
|
| + // by the shared ResourceBundle.
|
| + ImageType GetBitmapNamed(int resource_id);
|
| +
|
| PageInfoModelObserver* observer_;
|
|
|
| std::vector<SectionInfo> sections_;
|
|
|
| + // All possible icons that go next to the text descriptions to indicate state.
|
| + std::vector<ImageType> icons_;
|
| +
|
| // Used to request number of visits.
|
| CancelableRequestConsumer request_consumer_;
|
|
|
|
|