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_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_ |
6 #define CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 void AddSession(); | 27 void AddSession(); |
28 int GetSessionCount(); | 28 int GetSessionCount(); |
29 SessionID::id_type GetSessionID(int session_index); | 29 SessionID::id_type GetSessionID(int session_index); |
30 base::Time GetSessionTimestamp(int session_index); | 30 base::Time GetSessionTimestamp(int session_index); |
31 | 31 |
32 void AddWindow(int session_index); | 32 void AddWindow(int session_index); |
33 int GetWindowCount(int session_index); | 33 int GetWindowCount(int session_index); |
34 SessionID::id_type GetWindowID(int session_index, int window_index); | 34 SessionID::id_type GetWindowID(int session_index, int window_index); |
35 | 35 |
36 void AddTab(int session_index, int window_index); | 36 void AddTab(int session_index, int window_index); |
37 void AddTabWithTimestamp(int session_index, | 37 void AddTabWithInfo(int session_index, |
38 int window_index, | 38 int window_index, |
39 base::Time timestamp); | 39 base::Time timestamp, |
| 40 const string16& title); |
40 int GetTabCount(int session_index, int window_index); | 41 int GetTabCount(int session_index, int window_index); |
41 SessionID::id_type GetTabID(int session_index, | 42 SessionID::id_type GetTabID(int session_index, |
42 int window_index, | 43 int window_index, |
43 int tab_index); | 44 int tab_index); |
44 base::Time GetTabTimestamp(int session_index, | 45 base::Time GetTabTimestamp(int session_index, |
45 int window_index, | 46 int window_index, |
46 int tab_index); | 47 int tab_index); |
| 48 string16 GetTabTitle(int session_index, |
| 49 int window_index, |
| 50 int tab_index); |
47 | 51 |
48 void RegisterRecentTabs(browser_sync::SessionModelAssociator* associator); | 52 void RegisterRecentTabs(browser_sync::SessionModelAssociator* associator); |
49 | 53 |
50 std::vector<string16> GetTabTitlesSortedByRecency(); | 54 std::vector<string16> GetTabTitlesSortedByRecency(); |
51 | 55 |
52 private: | 56 private: |
53 void BuildSessionSpecifics(int session_index, | 57 void BuildSessionSpecifics(int session_index, |
54 sync_pb::SessionSpecifics* meta); | 58 sync_pb::SessionSpecifics* meta); |
55 void BuildWindowSpecifics(int session_index, | 59 void BuildWindowSpecifics(int session_index, |
56 int window_index, | 60 int window_index, |
57 sync_pb::SessionSpecifics* meta); | 61 sync_pb::SessionSpecifics* meta); |
58 void BuildTabSpecifics(int session_index, | 62 void BuildTabSpecifics(int session_index, |
59 int window_index, | 63 int window_index, |
60 int tab_index, | 64 int tab_index, |
61 sync_pb::SessionSpecifics* tab_base); | 65 sync_pb::SessionSpecifics* tab_base); |
62 | 66 |
63 struct TabInfo { | 67 struct TabInfo; |
64 SessionID::id_type id; | 68 struct WindowInfo; |
65 base::Time timestamp; | 69 struct SessionInfo; |
66 }; | |
67 struct WindowInfo { | |
68 WindowInfo(); | |
69 ~WindowInfo(); | |
70 SessionID::id_type id; | |
71 std::vector<TabInfo> tabs; | |
72 }; | |
73 struct SessionInfo { | |
74 SessionInfo(); | |
75 ~SessionInfo(); | |
76 SessionID::id_type id; | |
77 std::vector<WindowInfo> windows; | |
78 }; | |
79 | 70 |
80 std::vector<SessionInfo> sessions_; | 71 std::vector<SessionInfo> sessions_; |
81 base::Time start_time_; | 72 base::Time start_time_; |
82 | 73 |
83 DISALLOW_COPY_AND_ASSIGN(RecentTabsBuilderTestHelper); | 74 DISALLOW_COPY_AND_ASSIGN(RecentTabsBuilderTestHelper); |
84 }; | 75 }; |
85 | 76 |
86 #endif // CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_ | 77 #endif // CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_ |
OLD | NEW |