| OLD | NEW |
| 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_CUSTOM_HOME_PAGES_TABLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_CUSTOM_HOME_PAGES_TABLE_MODEL_H_ |
| 6 #define CHROME_BROWSER_CUSTOM_HOME_PAGES_TABLE_MODEL_H_ | 6 #define CHROME_BROWSER_CUSTOM_HOME_PAGES_TABLE_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void LoadTitleAndFavIcon(Entry* entry); | 62 void LoadTitleAndFavIcon(Entry* entry); |
| 63 | 63 |
| 64 // Callback from history service. Updates the title of the Entry whose | 64 // Callback from history service. Updates the title of the Entry whose |
| 65 // |title_handle| matches |handle| and notifies the observer of the change. | 65 // |title_handle| matches |handle| and notifies the observer of the change. |
| 66 void OnGotTitle(HistoryService::Handle handle, | 66 void OnGotTitle(HistoryService::Handle handle, |
| 67 bool found_url, | 67 bool found_url, |
| 68 const history::URLRow* row, | 68 const history::URLRow* row, |
| 69 history::VisitVector* visits); | 69 history::VisitVector* visits); |
| 70 | 70 |
| 71 // Callback from history service. Updates the icon of the Entry whose | 71 // Callback from history service. Updates the icon of the Entry whose |
| 72 // |fav_icon_handle| matches |handle| and notifies the observer of the change. | 72 // |favicon_handle| matches |handle| and notifies the observer of the change. |
| 73 void OnGotFavIcon(FaviconService::Handle handle, | 73 void OnGotFavIcon(FaviconService::Handle handle, |
| 74 bool know_fav_icon, | 74 bool know_favicon, |
| 75 scoped_refptr<RefCountedMemory> image_data, | 75 scoped_refptr<RefCountedMemory> image_data, |
| 76 bool is_expired, | 76 bool is_expired, |
| 77 GURL icon_url); | 77 GURL icon_url); |
| 78 | 78 |
| 79 // Returns the entry whose |member| matches |handle| and sets |entry_index| to | 79 // Returns the entry whose |member| matches |handle| and sets |entry_index| to |
| 80 // the index of the entry. | 80 // the index of the entry. |
| 81 Entry* GetEntryByLoadHandle(CancelableRequestProvider::Handle Entry::* member, | 81 Entry* GetEntryByLoadHandle(CancelableRequestProvider::Handle Entry::* member, |
| 82 CancelableRequestProvider::Handle handle, | 82 CancelableRequestProvider::Handle handle, |
| 83 int* entry_index); | 83 int* entry_index); |
| 84 | 84 |
| 85 // Returns the entry whose |fav_icon_handle| matches |handle| and sets | 85 // Returns the entry whose |favicon_handle| matches |handle| and sets |
| 86 // |entry_index| to the index of the entry. | 86 // |entry_index| to the index of the entry. |
| 87 Entry* GetEntryByFavIconHandle(FaviconService::Handle handle, | 87 Entry* GetEntryByFavIconHandle(FaviconService::Handle handle, |
| 88 int* entry_index); | 88 int* entry_index); |
| 89 | 89 |
| 90 // Returns the URL for a particular row, formatted for display to the user. | 90 // Returns the URL for a particular row, formatted for display to the user. |
| 91 string16 FormattedURL(int row) const; | 91 string16 FormattedURL(int row) const; |
| 92 | 92 |
| 93 // Set of entries we're showing. | 93 // Set of entries we're showing. |
| 94 std::vector<Entry> entries_; | 94 std::vector<Entry> entries_; |
| 95 | 95 |
| 96 // Default icon to show when one can't be found for the URL. | 96 // Default icon to show when one can't be found for the URL. |
| 97 SkBitmap* default_favicon_; | 97 SkBitmap* default_favicon_; |
| 98 | 98 |
| 99 // Profile used to load titles and icons. | 99 // Profile used to load titles and icons. |
| 100 Profile* profile_; | 100 Profile* profile_; |
| 101 | 101 |
| 102 ui::TableModelObserver* observer_; | 102 ui::TableModelObserver* observer_; |
| 103 | 103 |
| 104 // Used in loading titles and favicons. | 104 // Used in loading titles and favicons. |
| 105 CancelableRequestConsumer query_consumer_; | 105 CancelableRequestConsumer query_consumer_; |
| 106 | 106 |
| 107 DISALLOW_COPY_AND_ASSIGN(CustomHomePagesTableModel); | 107 DISALLOW_COPY_AND_ASSIGN(CustomHomePagesTableModel); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 #endif // CHROME_BROWSER_CUSTOM_HOME_PAGES_TABLE_MODEL_H_ | 110 #endif // CHROME_BROWSER_CUSTOM_HOME_PAGES_TABLE_MODEL_H_ |
| OLD | NEW |