| Index: chrome/browser/ui/browser_live_tab_context.cc
|
| diff --git a/chrome/browser/ui/browser_live_tab_context.cc b/chrome/browser/ui/browser_live_tab_context.cc
|
| index bf3672f1434b3277730cb319bf9901ea4ce5e337..867b17461be71a3cd35c423a4792eae6931fa437 100644
|
| --- a/chrome/browser/ui/browser_live_tab_context.cc
|
| +++ b/chrome/browser/ui/browser_live_tab_context.cc
|
| @@ -57,6 +57,18 @@ bool BrowserLiveTabContext::IsTabPinned(int index) const {
|
| return browser_->tab_strip_model()->IsTabPinned(index);
|
| }
|
|
|
| +const gfx::Rect BrowserLiveTabContext::GetRestoredBounds() const {
|
| + return browser_->window()->GetRestoredBounds();
|
| +}
|
| +
|
| +ui::WindowShowState BrowserLiveTabContext::GetRestoredState() const {
|
| + return browser_->window()->GetRestoredState();
|
| +}
|
| +
|
| +std::string BrowserLiveTabContext::GetWorkspace() const {
|
| + return browser_->window()->GetWorkspace();
|
| +}
|
| +
|
| sessions::LiveTab* BrowserLiveTabContext::AddRestoredTab(
|
| const std::vector<sessions::SerializedNavigationEntry>& navigations,
|
| int tab_index,
|
| @@ -127,19 +139,26 @@ void BrowserLiveTabContext::CloseTab() {
|
| // static
|
| sessions::LiveTabContext* BrowserLiveTabContext::Create(
|
| Profile* profile,
|
| - const std::string& app_name) {
|
| - Browser* browser;
|
| + const std::string& app_name,
|
| + const gfx::Rect& bounds,
|
| + ui::WindowShowState show_state,
|
| + const std::string& workspace) {
|
| + std::unique_ptr<Browser::CreateParams> create_params;
|
| if (app_name.empty()) {
|
| - browser = new Browser(Browser::CreateParams(profile, true));
|
| + create_params = base::MakeUnique<Browser::CreateParams>(
|
| + Browser::CreateParams(profile, true));
|
| + create_params->initial_bounds = bounds;
|
| } else {
|
| // Only trusted app popup windows should ever be restored.
|
| - browser = new Browser(Browser::CreateParams::CreateForApp(
|
| - app_name, true /* trusted_source */, gfx::Rect(), profile, true));
|
| + create_params = base::MakeUnique<Browser::CreateParams>(
|
| + Browser::CreateParams::CreateForApp(app_name, true /* trusted_source */,
|
| + bounds, profile,
|
| + true /* user_gesture */));
|
| }
|
| - if (browser)
|
| - return browser->live_tab_context();
|
| - else
|
| - return NULL;
|
| + create_params->initial_show_state = show_state;
|
| + create_params->initial_workspace = workspace;
|
| + Browser* browser = new Browser(*create_params.get());
|
| + return browser->live_tab_context();
|
| }
|
|
|
| // static
|
|
|