OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Describes a class that can represent the information displayed in a history | 5 // Describes a class that can represent the information displayed in a history |
6 // view; that is, a list of visited pages. This object knows how to | 6 // view; that is, a list of visited pages. This object knows how to |
7 // talk to the HistoryService to update its state. | 7 // talk to the HistoryService to update its state. |
8 | 8 |
9 #ifndef CHROME_BROWSER_HISTORY_MODEL_H__ | 9 #ifndef CHROME_BROWSER_HISTORY_MODEL_H__ |
10 #define CHROME_BROWSER_HISTORY_MODEL_H__ | 10 #define CHROME_BROWSER_HISTORY_MODEL_H__ |
11 | 11 |
12 #include "chrome/browser/base_history_model.h" | 12 #include "chrome/browser/base_history_model.h" |
13 #include "chrome/common/notification_service.h" | 13 #include "chrome/common/notification_service.h" |
14 | 14 |
15 typedef BaseHistoryModelObserver HistoryModelObserver; | 15 typedef BaseHistoryModelObserver HistoryModelObserver; |
16 | 16 |
17 class HistoryModel : public BaseHistoryModel, | 17 class HistoryModel : public BaseHistoryModel, |
18 public NotificationObserver { | 18 public NotificationObserver { |
19 public: | 19 public: |
20 HistoryModel(Profile* profile, const std::wstring& search_text); | 20 HistoryModel(Profile* profile, const std::wstring& search_text); |
21 virtual ~HistoryModel(); | 21 virtual ~HistoryModel(); |
22 | 22 |
23 // BaseHistoryModel methods (see BaseHistoryModel for description). | 23 // BaseHistoryModel methods (see BaseHistoryModel for description). |
24 virtual int GetItemCount(); | 24 virtual int GetItemCount(); |
25 virtual Time GetVisitTime(int index); | 25 virtual base::Time GetVisitTime(int index); |
26 virtual const std::wstring& GetTitle(int index); | 26 virtual const std::wstring& GetTitle(int index); |
27 virtual const GURL& GetURL(int index); | 27 virtual const GURL& GetURL(int index); |
28 virtual history::URLID GetURLID(int index); | 28 virtual history::URLID GetURLID(int index); |
29 virtual bool IsStarred(int index); | 29 virtual bool IsStarred(int index); |
30 virtual const Snippet& GetSnippet(int index); | 30 virtual const Snippet& GetSnippet(int index); |
31 virtual void RemoveFromModel(int start, int length); | 31 virtual void RemoveFromModel(int start, int length); |
32 | 32 |
33 // Sets the new value of the search text, and requeries if the new value | 33 // Sets the new value of the search text, and requeries if the new value |
34 // is different from the previous value. | 34 // is different from the previous value. |
35 virtual void SetSearchText(const std::wstring& search_text); | 35 virtual void SetSearchText(const std::wstring& search_text); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 }; | 76 }; |
77 | 77 |
78 // star_state_ has an entry for each element of results_ indicating whether | 78 // star_state_ has an entry for each element of results_ indicating whether |
79 // the URL is starred. | 79 // the URL is starred. |
80 scoped_array<StarState> star_state_; | 80 scoped_array<StarState> star_state_; |
81 | 81 |
82 // How many months back the current query has gone. | 82 // How many months back the current query has gone. |
83 int search_depth_; | 83 int search_depth_; |
84 | 84 |
85 // The time that the current query was started. | 85 // The time that the current query was started. |
86 Time search_start_; | 86 base::Time search_start_; |
87 | 87 |
88 DISALLOW_EVIL_CONSTRUCTORS(HistoryModel); | 88 DISALLOW_EVIL_CONSTRUCTORS(HistoryModel); |
89 }; | 89 }; |
90 | 90 |
91 #endif // CHROME_BROWSER_HISTORY_MODEL_H__ | 91 #endif // CHROME_BROWSER_HISTORY_MODEL_H__ |
92 | 92 |
OLD | NEW |