Index: chrome/browser/ui/android/tab_model/android_live_tab_context.cc |
diff --git a/chrome/browser/ui/android/tab_model/android_live_tab_context.cc b/chrome/browser/ui/android/tab_model/android_live_tab_context.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b62fc59b57ec6f0ca0ba33cb5696060060f51c74 |
--- /dev/null |
+++ b/chrome/browser/ui/android/tab_model/android_live_tab_context.cc |
@@ -0,0 +1,80 @@ |
+// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
Ted C
2016/06/28 19:49:49
no (c) anymore
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/android/tab_android.h" |
+#include "chrome/browser/ui/android/tab_model/android_live_tab_context.h" |
+#include "chrome/browser/ui/android/tab_model/tab_model.h" |
+#include "chrome/browser/ui/android/tab_model/tab_model_list.h" |
+ |
+void AndroidLiveTabContext::ShowBrowserWindow() { |
+} |
+ |
+const SessionID& AndroidLiveTabContext::GetSessionID() const { |
+ return tab_model_->SessionId(); |
+} |
+ |
+int AndroidLiveTabContext::GetTabCount() const { |
+ return tab_model_->GetTabCount(); |
+} |
+ |
+int AndroidLiveTabContext::GetSelectedIndex() const { |
+ return tab_model_->GetActiveIndex(); |
+} |
+ |
+// Not supported by android right now. |
+std::string AndroidLiveTabContext::GetAppName() const { |
+ return ""; |
sky
2016/06/28 19:13:37
std::string()
|
+} |
+ |
+// Not supported by android right now. |
+sessions::LiveTab* AndroidLiveTabContext::GetLiveTabAt(int index) const { |
+ return nullptr; |
+} |
+ |
+// Not supported by android right now. |
+sessions::LiveTab* AndroidLiveTabContext::GetActiveLiveTab() const { |
+ return nullptr; |
Ted C
2016/06/28 19:49:49
This "seems" like something we could add right now
|
+} |
+ |
+bool AndroidLiveTabContext::IsTabPinned(int index) const { |
+ return false; |
Ted C
2016/06/28 19:49:49
Add a comment that Android does not support the co
|
+} |
+ |
+// Currently do nothing, we communicate with java in tab_android.cc. |
+sessions::LiveTab* AndroidLiveTabContext::AddRestoredTab( |
+ const std::vector<sessions::SerializedNavigationEntry>& navigations, |
+ int tab_index, |
+ int selected_navigation, |
+ const std::string& extension_app_id, |
+ bool select, |
+ bool pin, |
+ bool from_last_session, |
+ const sessions::PlatformSpecificTabData* tab_platform_data, |
+ const std::string& user_agent_override) { |
+ return nullptr; |
+} |
+ |
+// Currently do nothing, we communicate with java in tab_android.cc. |
+sessions::LiveTab* AndroidLiveTabContext::ReplaceRestoredTab( |
+ const std::vector<sessions::SerializedNavigationEntry>& navigations, |
+ int selected_navigation, |
+ bool from_last_session, |
+ const std::string& extension_app_id, |
+ const sessions::PlatformSpecificTabData* tab_platform_data, |
+ const std::string& user_agent_override) { |
+ return nullptr; |
+} |
+ |
+void AndroidLiveTabContext::CloseTab() { |
Ted C
2016/06/28 19:49:49
We should add NOTIMPLEMENTED() in places like this
|
+} |
+ |
+sessions::LiveTabContext* AndroidLiveTabContext::FindContextForWebContents( |
sky
2016/06/28 19:13:37
// static
|
+ const content::WebContents* contents) { |
+ TabAndroid* tab_android = TabAndroid::FromWebContents(contents); |
+ TabModel* model = TabModelList::FindTabModelWithId( |
+ tab_android->window_id().id()); |
+ |
+ return model ? model->GetLiveTabContext() : nullptr; |
+} |
+ |