Add a minor text member to ui::MenuModel.
[chromium-blink-merge.git] / chrome / browser / ui / toolbar / recent_tabs_builder_test_helper.h
blobac7492bc2929edfb33aeabc41e698b90848165f9
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_
8 #include <vector>
10 #include "base/strings/string16.h"
11 #include "base/time/time.h"
12 #include "chrome/browser/sessions/session_id.h"
14 namespace browser_sync {
15 class SessionModelAssociator;
17 namespace sync_pb {
18 class SessionSpecifics;
21 // Utility class to help add recent tabs for testing.
22 class RecentTabsBuilderTestHelper {
23 public:
24 RecentTabsBuilderTestHelper();
25 ~RecentTabsBuilderTestHelper();
27 void AddSession();
28 int GetSessionCount();
29 SessionID::id_type GetSessionID(int session_index);
30 base::Time GetSessionTimestamp(int session_index);
32 void AddWindow(int session_index);
33 int GetWindowCount(int session_index);
34 SessionID::id_type GetWindowID(int session_index, int window_index);
36 void AddTab(int session_index, int window_index);
37 void AddTabWithInfo(int session_index,
38 int window_index,
39 base::Time timestamp,
40 const string16& title);
41 int GetTabCount(int session_index, int window_index);
42 SessionID::id_type GetTabID(int session_index,
43 int window_index,
44 int tab_index);
45 base::Time GetTabTimestamp(int session_index,
46 int window_index,
47 int tab_index);
48 string16 GetTabTitle(int session_index,
49 int window_index,
50 int tab_index);
52 void RegisterRecentTabs(browser_sync::SessionModelAssociator* associator);
54 std::vector<string16> GetTabTitlesSortedByRecency();
56 private:
57 void BuildSessionSpecifics(int session_index,
58 sync_pb::SessionSpecifics* meta);
59 void BuildWindowSpecifics(int session_index,
60 int window_index,
61 sync_pb::SessionSpecifics* meta);
62 void BuildTabSpecifics(int session_index,
63 int window_index,
64 int tab_index,
65 sync_pb::SessionSpecifics* tab_base);
67 struct TabInfo;
68 struct WindowInfo;
69 struct SessionInfo;
71 std::vector<SessionInfo> sessions_;
72 base::Time start_time_;
74 int max_tab_node_id_;
76 DISALLOW_COPY_AND_ASSIGN(RecentTabsBuilderTestHelper);
79 #endif // CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_BUILDER_TEST_HELPER_H_