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

Side by Side Diff: chrome/browser/ui/scoped_tabbed_browser_displayer.cc

Issue 2685333005: ash: fix regression where ctrl+n put new window on wrong desktop (Closed)
Patch Set: Rebase to ToT Created 3 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/scoped_tabbed_browser_displayer.h" 5 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
6 6
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_finder.h" 8 #include "chrome/browser/ui/browser_finder.h"
9 #include "chrome/browser/ui/browser_window.h" 9 #include "chrome/browser/ui/browser_window.h"
10 10
11 namespace chrome { 11 namespace chrome {
12 12
13 ScopedTabbedBrowserDisplayer::ScopedTabbedBrowserDisplayer(Profile* profile) { 13 ScopedTabbedBrowserDisplayer::ScopedTabbedBrowserDisplayer(Profile* profile) {
14 browser_ = FindTabbedBrowser(profile, false); 14 browser_ = FindTabbedBrowser(profile, false);
15 if (!browser_) 15 if (!browser_)
16 browser_ = new Browser(Browser::CreateParams(profile)); 16 browser_ = new Browser(Browser::CreateParams(profile, true));
17 } 17 }
18 18
19 ScopedTabbedBrowserDisplayer::~ScopedTabbedBrowserDisplayer() { 19 ScopedTabbedBrowserDisplayer::~ScopedTabbedBrowserDisplayer() {
20 // Make sure to restore the window, since window()->Show() will not unminimize 20 // Make sure to restore the window, since window()->Show() will not unminimize
21 // it. 21 // it.
22 if (browser_->window()->IsMinimized()) 22 if (browser_->window()->IsMinimized())
23 browser_->window()->Restore(); 23 browser_->window()->Restore();
24 24
25 browser_->window()->Show(); 25 browser_->window()->Show();
26 } 26 }
27 27
28 } // namespace chrome 28 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698