| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
| 8 #include <string> | |
| 9 #include <vector> | 8 #include <vector> |
| 10 | 9 |
| 10 #include "base/string16.h" |
| 11 #include "chrome/browser/cancelable_request.h" | 11 #include "chrome/browser/cancelable_request.h" |
| 12 #include "chrome/browser/history/history.h" | 12 #include "chrome/browser/history/history.h" |
| 13 #include "chrome/browser/tab_contents/navigation_entry.h" | 13 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 | 15 |
| 16 class PrefService; | 16 class PrefService; |
| 17 class Profile; | 17 class Profile; |
| 18 | 18 |
| 19 // The model that provides the information that should be displayed in the page | 19 // The model that provides the information that should be displayed in the page |
| 20 // info dialog. | 20 // info dialog. |
| 21 class PageInfoModel { | 21 class PageInfoModel { |
| 22 public: | 22 public: |
| 23 class PageInfoModelObserver { | 23 class PageInfoModelObserver { |
| 24 public: | 24 public: |
| 25 virtual void ModelChanged() = 0; | 25 virtual void ModelChanged() = 0; |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 // Because the UI on the Mac is statically laid-out, this enum provides the | 28 // Because the UI on the Mac is statically laid-out, this enum provides the |
| 29 // section type for the associated index. It is only used on Mac. | 29 // section type for the associated index. It is only used on Mac. |
| 30 // Ideally the view wouldn't have to know anything regarding the semantics of | 30 // Ideally the view wouldn't have to know anything regarding the semantics of |
| 31 // the model and would only use GetSectionCount()/GetSectionInfo(). | 31 // the model and would only use GetSectionCount()/GetSectionInfo(). |
| 32 enum SectionType { | 32 enum SectionType { |
| 33 IDENTITY = 0, | 33 IDENTITY = 0, |
| 34 CONNECTION, | 34 CONNECTION, |
| 35 HISTORY | 35 HISTORY |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 struct SectionInfo { | 38 struct SectionInfo { |
| 39 SectionInfo(bool state, | 39 SectionInfo(bool state, |
| 40 const std::wstring& title, | 40 const string16& title, |
| 41 const std::wstring& head_line, | 41 const string16& head_line, |
| 42 const std::wstring& description) | 42 const string16& description) |
| 43 : state(state), | 43 : state(state), |
| 44 title(title), | 44 title(title), |
| 45 head_line(head_line), | 45 head_line(head_line), |
| 46 description(description) { | 46 description(description) { |
| 47 } | 47 } |
| 48 | 48 |
| 49 bool state; // True if state is OK, false otherwise (ex of bad states: | 49 bool state; // True if state is OK, false otherwise (ex of bad states: |
| 50 // unverified identity over HTTPS). | 50 // unverified identity over HTTPS). |
| 51 | 51 |
| 52 // The title of the section. | 52 // The title of the section. |
| 53 std::wstring title; | 53 string16 title; |
| 54 | 54 |
| 55 // A single line describing the section, optional. | 55 // A single line describing the section, optional. |
| 56 std::wstring head_line; | 56 string16 head_line; |
| 57 | 57 |
| 58 // The full description of what this section is. | 58 // The full description of what this section is. |
| 59 std::wstring description; | 59 string16 description; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 PageInfoModel(Profile* profile, | 62 PageInfoModel(Profile* profile, |
| 63 const GURL& url, | 63 const GURL& url, |
| 64 const NavigationEntry::SSLStatus& ssl, | 64 const NavigationEntry::SSLStatus& ssl, |
| 65 bool show_history, | 65 bool show_history, |
| 66 PageInfoModelObserver* observer); | 66 PageInfoModelObserver* observer); |
| 67 | 67 |
| 68 int GetSectionCount(); | 68 int GetSectionCount(); |
| 69 SectionInfo GetSectionInfo(int index); | 69 SectionInfo GetSectionInfo(int index); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 81 | 81 |
| 82 std::vector<SectionInfo> sections_; | 82 std::vector<SectionInfo> sections_; |
| 83 | 83 |
| 84 // Used to request number of visits. | 84 // Used to request number of visits. |
| 85 CancelableRequestConsumer request_consumer_; | 85 CancelableRequestConsumer request_consumer_; |
| 86 | 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(PageInfoModel); | 87 DISALLOW_COPY_AND_ASSIGN(PageInfoModel); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 #endif // CHROME_BROWSER_PAGE_INFO_MODEL_H_ | 90 #endif // CHROME_BROWSER_PAGE_INFO_MODEL_H_ |
| OLD | NEW |