OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/task/cancelable_task_tracker.h" | 13 #include "base/task/cancelable_task_tracker.h" |
14 #include "components/history/core/browser/history_types.h" | 14 #include "components/history/core/browser/history_types.h" |
15 #include "ui/base/models/table_model.h" | 15 #include "ui/base/models/table_model.h" |
16 | 16 |
17 class Browser; | 17 class Browser; |
18 class GURL; | 18 class GURL; |
19 class Profile; | 19 class Profile; |
20 | 20 |
| 21 namespace content { |
| 22 class WebContents; |
| 23 } |
| 24 |
21 namespace history { | 25 namespace history { |
22 class URLRow; | 26 class URLRow; |
23 } | 27 } |
24 | 28 |
25 namespace ui { | 29 namespace ui { |
26 class TableModelObserver; | 30 class TableModelObserver; |
27 } | 31 } |
28 | 32 |
29 // CustomHomePagesTableModel is the model for the TableView showing the list | 33 // CustomHomePagesTableModel is the model for the TableView showing the list |
30 // of pages the user wants opened on startup. | 34 // of pages the user wants opened on startup. |
(...skipping 11 matching lines...) Expand all Loading... |
42 // Expects |index_list| to be ordered ascending. | 46 // Expects |index_list| to be ordered ascending. |
43 void MoveURLs(int insert_before, const std::vector<int>& index_list); | 47 void MoveURLs(int insert_before, const std::vector<int>& index_list); |
44 | 48 |
45 // Adds an entry at the specified index. | 49 // Adds an entry at the specified index. |
46 void Add(int index, const GURL& url); | 50 void Add(int index, const GURL& url); |
47 | 51 |
48 // Removes the entry at the specified index. | 52 // Removes the entry at the specified index. |
49 void Remove(int index); | 53 void Remove(int index); |
50 | 54 |
51 // Clears any entries and fills the list with pages currently opened in the | 55 // Clears any entries and fills the list with pages currently opened in the |
52 // browser. | 56 // browser. |ignore_contents| is omitted from the open pages. |
53 void SetToCurrentlyOpenPages(); | 57 void SetToCurrentlyOpenPages(const content::WebContents* ignore_contents); |
54 | 58 |
55 // Returns the set of urls this model contains. | 59 // Returns the set of urls this model contains. |
56 std::vector<GURL> GetURLs(); | 60 std::vector<GURL> GetURLs(); |
57 | 61 |
58 // TableModel overrides: | 62 // TableModel overrides: |
59 int RowCount() override; | 63 int RowCount() override; |
60 base::string16 GetText(int row, int column_id) override; | 64 base::string16 GetText(int row, int column_id) override; |
61 base::string16 GetTooltip(int row) override; | 65 base::string16 GetTooltip(int row) override; |
62 void SetObserver(ui::TableModelObserver* observer) override; | 66 void SetObserver(ui::TableModelObserver* observer) override; |
63 | 67 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 base::CancelableTaskTracker task_tracker_; | 118 base::CancelableTaskTracker task_tracker_; |
115 | 119 |
116 // Used to keep track of when it's time to update the observer when loading | 120 // Used to keep track of when it's time to update the observer when loading |
117 // multiple titles. | 121 // multiple titles. |
118 int num_outstanding_title_lookups_; | 122 int num_outstanding_title_lookups_; |
119 | 123 |
120 DISALLOW_COPY_AND_ASSIGN(CustomHomePagesTableModel); | 124 DISALLOW_COPY_AND_ASSIGN(CustomHomePagesTableModel); |
121 }; | 125 }; |
122 | 126 |
123 #endif // CHROME_BROWSER_CUSTOM_HOME_PAGES_TABLE_MODEL_H_ | 127 #endif // CHROME_BROWSER_CUSTOM_HOME_PAGES_TABLE_MODEL_H_ |
OLD | NEW |