Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: chrome/browser/ui/android/tab_model/android_live_tab_context.cc

Issue 2868983003: Ensure History > Recent Tabs restore preserves window disposition. (Closed)
Patch Set: Remove NOTREACHED(). Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "chrome/browser/android/tab_android.h" 5 #include "chrome/browser/android/tab_android.h"
6 #include "chrome/browser/profiles/profile.h" 6 #include "chrome/browser/profiles/profile.h"
7 #include "chrome/browser/ui/android/tab_model/android_live_tab_context.h" 7 #include "chrome/browser/ui/android/tab_model/android_live_tab_context.h"
8 #include "chrome/browser/ui/android/tab_model/tab_model.h" 8 #include "chrome/browser/ui/android/tab_model/tab_model.h"
9 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" 9 #include "chrome/browser/ui/android/tab_model/tab_model_list.h"
10 #include "components/sessions/content/content_live_tab.h" 10 #include "components/sessions/content/content_live_tab.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 int AndroidLiveTabContext::GetTabCount() const { 27 int AndroidLiveTabContext::GetTabCount() const {
28 return tab_model_->GetTabCount(); 28 return tab_model_->GetTabCount();
29 } 29 }
30 30
31 int AndroidLiveTabContext::GetSelectedIndex() const { 31 int AndroidLiveTabContext::GetSelectedIndex() const {
32 return tab_model_->GetActiveIndex(); 32 return tab_model_->GetActiveIndex();
33 } 33 }
34 34
35 // Not supported by android.
36 std::string AndroidLiveTabContext::GetAppName() const { 35 std::string AndroidLiveTabContext::GetAppName() const {
36 // Not applicable to android.
37 return std::string(); 37 return std::string();
38 } 38 }
39 39
40 sessions::LiveTab* AndroidLiveTabContext::GetLiveTabAt(int index) const { 40 sessions::LiveTab* AndroidLiveTabContext::GetLiveTabAt(int index) const {
41 TabAndroid* tab_android = tab_model_->GetTabAt(index); 41 TabAndroid* tab_android = tab_model_->GetTabAt(index);
42 if (!tab_android || !tab_android->web_contents()) 42 if (!tab_android || !tab_android->web_contents())
43 return nullptr; 43 return nullptr;
44 44
45 return sessions::ContentLiveTab::GetForWebContents( 45 return sessions::ContentLiveTab::GetForWebContents(
46 tab_android->web_contents()); 46 tab_android->web_contents());
47 } 47 }
48 48
49 sessions::LiveTab* AndroidLiveTabContext::GetActiveLiveTab() const { 49 sessions::LiveTab* AndroidLiveTabContext::GetActiveLiveTab() const {
50 content::WebContents* web_contents = tab_model_->GetActiveWebContents(); 50 content::WebContents* web_contents = tab_model_->GetActiveWebContents();
51 if (!web_contents) 51 if (!web_contents)
52 return nullptr; 52 return nullptr;
53 53
54 return sessions::ContentLiveTab::GetForWebContents(web_contents); 54 return sessions::ContentLiveTab::GetForWebContents(web_contents);
55 } 55 }
56 56
57 // Not supported by android.
58 bool AndroidLiveTabContext::IsTabPinned(int index) const { 57 bool AndroidLiveTabContext::IsTabPinned(int index) const {
58 // Not applicable to android.
59 return false; 59 return false;
60 } 60 }
61 61
62 const gfx::Rect AndroidLiveTabContext::GetRestoredBounds() const {
63 // Not applicable to android.
64 return gfx::Rect();
65 }
66
67 ui::WindowShowState AndroidLiveTabContext::GetRestoredState() const {
68 // Not applicable to android.
69 return ui::SHOW_STATE_NORMAL;
70 }
71
72 std::string AndroidLiveTabContext::GetWorkspace() const {
73 // Not applicable to android.
74 return std::string();
75 }
76
62 sessions::LiveTab* AndroidLiveTabContext::AddRestoredTab( 77 sessions::LiveTab* AndroidLiveTabContext::AddRestoredTab(
63 const std::vector<sessions::SerializedNavigationEntry>& navigations, 78 const std::vector<sessions::SerializedNavigationEntry>& navigations,
64 int tab_index, 79 int tab_index,
65 int selected_navigation, 80 int selected_navigation,
66 const std::string& extension_app_id, 81 const std::string& extension_app_id,
67 bool select, 82 bool select,
68 bool pin, 83 bool pin,
69 bool from_last_session, 84 bool from_last_session,
70 const sessions::PlatformSpecificTabData* tab_platform_data, 85 const sessions::PlatformSpecificTabData* tab_platform_data,
71 const std::string& user_agent_override) { 86 const std::string& user_agent_override) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 for (auto it = TabModelList::begin(); it != TabModelList::end(); ++it) { 144 for (auto it = TabModelList::begin(); it != TabModelList::end(); ++it) {
130 TabModel* model = *it; 145 TabModel* model = *it;
131 if (!model->IsOffTheRecord()) { 146 if (!model->IsOffTheRecord()) {
132 return model->GetLiveTabContext(); 147 return model->GetLiveTabContext();
133 } 148 }
134 } 149 }
135 } 150 }
136 151
137 return tab_model ? tab_model->GetLiveTabContext() : nullptr; 152 return tab_model ? tab_model->GetLiveTabContext() : nullptr;
138 } 153 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/tab_model/android_live_tab_context.h ('k') | chrome/browser/ui/browser_live_tab_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698