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

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

Issue 2685333005: ash: fix regression where ctrl+n put new window on wrong desktop (Closed)
Patch Set: Rebase to ToT Created 3 years, 10 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
« no previous file with comments | « chrome/browser/ui/browser_navigator_browsertest.cc ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser_tab_strip_model_delegate.h" 5 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 chrome::AddTabAt(browser_, url, index, foreground); 50 chrome::AddTabAt(browser_, url, index, foreground);
51 } 51 }
52 52
53 Browser* BrowserTabStripModelDelegate::CreateNewStripWithContents( 53 Browser* BrowserTabStripModelDelegate::CreateNewStripWithContents(
54 const std::vector<NewStripContents>& contentses, 54 const std::vector<NewStripContents>& contentses,
55 const gfx::Rect& window_bounds, 55 const gfx::Rect& window_bounds,
56 bool maximize) { 56 bool maximize) {
57 DCHECK(browser_->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)); 57 DCHECK(browser_->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP));
58 58
59 // Create an empty new browser window the same size as the old one. 59 // Create an empty new browser window the same size as the old one.
60 Browser::CreateParams params(browser_->profile()); 60 Browser::CreateParams params(browser_->profile(), true);
61 params.initial_bounds = window_bounds; 61 params.initial_bounds = window_bounds;
62 params.initial_show_state = 62 params.initial_show_state =
63 maximize ? ui::SHOW_STATE_MAXIMIZED : ui::SHOW_STATE_NORMAL; 63 maximize ? ui::SHOW_STATE_MAXIMIZED : ui::SHOW_STATE_NORMAL;
64 Browser* browser = new Browser(params); 64 Browser* browser = new Browser(params);
65 TabStripModel* new_model = browser->tab_strip_model(); 65 TabStripModel* new_model = browser->tab_strip_model();
66 66
67 for (size_t i = 0; i < contentses.size(); ++i) { 67 for (size_t i = 0; i < contentses.size(); ++i) {
68 NewStripContents item = contentses[i]; 68 NewStripContents item = contentses[i];
69 69
70 // Enforce that there is an active tab in the strip at all times by forcing 70 // Enforce that there is an active tab in the strip at all times by forcing
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 153
154 //////////////////////////////////////////////////////////////////////////////// 154 ////////////////////////////////////////////////////////////////////////////////
155 // BrowserTabStripModelDelegate, private: 155 // BrowserTabStripModelDelegate, private:
156 156
157 void BrowserTabStripModelDelegate::CloseFrame() { 157 void BrowserTabStripModelDelegate::CloseFrame() {
158 browser_->window()->Close(); 158 browser_->window()->Close();
159 } 159 }
160 160
161 } // namespace chrome 161 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_navigator_browsertest.cc ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698