OLD | NEW |
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 Loading... |
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()); |
61 browser_->host_desktop_type()); | |
62 params.initial_bounds = window_bounds; | 61 params.initial_bounds = window_bounds; |
63 params.initial_show_state = | 62 params.initial_show_state = |
64 maximize ? ui::SHOW_STATE_MAXIMIZED : ui::SHOW_STATE_NORMAL; | 63 maximize ? ui::SHOW_STATE_MAXIMIZED : ui::SHOW_STATE_NORMAL; |
65 Browser* browser = new Browser(params); | 64 Browser* browser = new Browser(params); |
66 TabStripModel* new_model = browser->tab_strip_model(); | 65 TabStripModel* new_model = browser->tab_strip_model(); |
67 | 66 |
68 for (size_t i = 0; i < contentses.size(); ++i) { | 67 for (size_t i = 0; i < contentses.size(); ++i) { |
69 NewStripContents item = contentses[i]; | 68 NewStripContents item = contentses[i]; |
70 | 69 |
71 // 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 160 } |
162 | 161 |
163 //////////////////////////////////////////////////////////////////////////////// | 162 //////////////////////////////////////////////////////////////////////////////// |
164 // BrowserTabStripModelDelegate, private: | 163 // BrowserTabStripModelDelegate, private: |
165 | 164 |
166 void BrowserTabStripModelDelegate::CloseFrame() { | 165 void BrowserTabStripModelDelegate::CloseFrame() { |
167 browser_->window()->Close(); | 166 browser_->window()->Close(); |
168 } | 167 } |
169 | 168 |
170 } // namespace chrome | 169 } // namespace chrome |
OLD | NEW |