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

Side by Side Diff: chrome/browser/sessions/chrome_tab_restore_service_client.cc

Issue 2868983003: Ensure History > Recent Tabs restore preserves window disposition. (Closed)
Patch Set: More iOS fixes. Created 3 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/sessions/chrome_tab_restore_service_client.h" 5 #include "chrome/browser/sessions/chrome_tab_restore_service_client.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/sessions/session_service.h" 9 #include "chrome/browser/sessions/session_service.h"
10 #include "chrome/browser/sessions/session_service_factory.h" 10 #include "chrome/browser/sessions/session_service_factory.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 } // namespace 47 } // namespace
48 48
49 ChromeTabRestoreServiceClient::ChromeTabRestoreServiceClient(Profile* profile) 49 ChromeTabRestoreServiceClient::ChromeTabRestoreServiceClient(Profile* profile)
50 : profile_(profile) {} 50 : profile_(profile) {}
51 51
52 ChromeTabRestoreServiceClient::~ChromeTabRestoreServiceClient() {} 52 ChromeTabRestoreServiceClient::~ChromeTabRestoreServiceClient() {}
53 53
54 sessions::LiveTabContext* ChromeTabRestoreServiceClient::CreateLiveTabContext( 54 sessions::LiveTabContext* ChromeTabRestoreServiceClient::CreateLiveTabContext(
55 const std::string& app_name) { 55 const std::string& app_name,
56 const gfx::Rect& bounds,
57 ui::WindowShowState show_state,
58 const std::string& workspace) {
56 #if defined(OS_ANDROID) 59 #if defined(OS_ANDROID)
57 // Android does not support creating a LiveTabContext here. 60 // Android does not support creating a LiveTabContext here.
58 NOTREACHED(); 61 NOTREACHED();
59 return nullptr; 62 return nullptr;
60 #else 63 #else
61 return BrowserLiveTabContext::Create(profile_, app_name); 64 return BrowserLiveTabContext::Create(profile_, app_name, bounds, show_state,
65 workspace);
62 #endif 66 #endif
63 } 67 }
64 68
65 sessions::LiveTabContext* 69 sessions::LiveTabContext*
66 ChromeTabRestoreServiceClient::FindLiveTabContextForTab( 70 ChromeTabRestoreServiceClient::FindLiveTabContextForTab(
67 const sessions::LiveTab* tab) { 71 const sessions::LiveTab* tab) {
68 #if defined(OS_ANDROID) 72 #if defined(OS_ANDROID)
69 return AndroidLiveTabContext::FindContextForWebContents( 73 return AndroidLiveTabContext::FindContextForWebContents(
70 static_cast<const sessions::ContentLiveTab*>(tab)->web_contents()); 74 static_cast<const sessions::ContentLiveTab*>(tab)->web_contents());
71 #else 75 #else
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 DCHECK(HasLastSession()); 148 DCHECK(HasLastSession());
145 #if BUILDFLAG(ENABLE_SESSION_SERVICE) 149 #if BUILDFLAG(ENABLE_SESSION_SERVICE)
146 SessionServiceFactory::GetForProfile(profile_) 150 SessionServiceFactory::GetForProfile(profile_)
147 ->GetLastSession(callback, tracker); 151 ->GetLastSession(callback, tracker);
148 #endif 152 #endif
149 } 153 }
150 154
151 void ChromeTabRestoreServiceClient::OnTabRestored(const GURL& url) { 155 void ChromeTabRestoreServiceClient::OnTabRestored(const GURL& url) {
152 RecordAppLaunch(profile_, url); 156 RecordAppLaunch(profile_, url);
153 } 157 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698