OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
Ted C
2016/06/28 19:49:49
no (c) anymore
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/android/tab_android.h" | |
6 #include "chrome/browser/ui/android/tab_model/android_live_tab_context.h" | |
7 #include "chrome/browser/ui/android/tab_model/tab_model.h" | |
8 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" | |
9 | |
10 void AndroidLiveTabContext::ShowBrowserWindow() { | |
11 } | |
12 | |
13 const SessionID& AndroidLiveTabContext::GetSessionID() const { | |
14 return tab_model_->SessionId(); | |
15 } | |
16 | |
17 int AndroidLiveTabContext::GetTabCount() const { | |
18 return tab_model_->GetTabCount(); | |
19 } | |
20 | |
21 int AndroidLiveTabContext::GetSelectedIndex() const { | |
22 return tab_model_->GetActiveIndex(); | |
23 } | |
24 | |
25 // Not supported by android right now. | |
26 std::string AndroidLiveTabContext::GetAppName() const { | |
27 return ""; | |
sky
2016/06/28 19:13:37
std::string()
| |
28 } | |
29 | |
30 // Not supported by android right now. | |
31 sessions::LiveTab* AndroidLiveTabContext::GetLiveTabAt(int index) const { | |
32 return nullptr; | |
33 } | |
34 | |
35 // Not supported by android right now. | |
36 sessions::LiveTab* AndroidLiveTabContext::GetActiveLiveTab() const { | |
37 return nullptr; | |
Ted C
2016/06/28 19:49:49
This "seems" like something we could add right now
| |
38 } | |
39 | |
40 bool AndroidLiveTabContext::IsTabPinned(int index) const { | |
41 return false; | |
Ted C
2016/06/28 19:49:49
Add a comment that Android does not support the co
| |
42 } | |
43 | |
44 // Currently do nothing, we communicate with java in tab_android.cc. | |
45 sessions::LiveTab* AndroidLiveTabContext::AddRestoredTab( | |
46 const std::vector<sessions::SerializedNavigationEntry>& navigations, | |
47 int tab_index, | |
48 int selected_navigation, | |
49 const std::string& extension_app_id, | |
50 bool select, | |
51 bool pin, | |
52 bool from_last_session, | |
53 const sessions::PlatformSpecificTabData* tab_platform_data, | |
54 const std::string& user_agent_override) { | |
55 return nullptr; | |
56 } | |
57 | |
58 // Currently do nothing, we communicate with java in tab_android.cc. | |
59 sessions::LiveTab* AndroidLiveTabContext::ReplaceRestoredTab( | |
60 const std::vector<sessions::SerializedNavigationEntry>& navigations, | |
61 int selected_navigation, | |
62 bool from_last_session, | |
63 const std::string& extension_app_id, | |
64 const sessions::PlatformSpecificTabData* tab_platform_data, | |
65 const std::string& user_agent_override) { | |
66 return nullptr; | |
67 } | |
68 | |
69 void AndroidLiveTabContext::CloseTab() { | |
Ted C
2016/06/28 19:49:49
We should add NOTIMPLEMENTED() in places like this
| |
70 } | |
71 | |
72 sessions::LiveTabContext* AndroidLiveTabContext::FindContextForWebContents( | |
sky
2016/06/28 19:13:37
// static
| |
73 const content::WebContents* contents) { | |
74 TabAndroid* tab_android = TabAndroid::FromWebContents(contents); | |
75 TabModel* model = TabModelList::FindTabModelWithId( | |
76 tab_android->window_id().id()); | |
77 | |
78 return model ? model->GetLiveTabContext() : nullptr; | |
79 } | |
80 | |
OLD | NEW |