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/panels/panel_browser_window.h" | 5 #include "chrome/browser/ui/panels/panel_browser_window.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 Browser* tabbed_browser = browser::FindTabbedBrowser(profile, true); | 330 Browser* tabbed_browser = browser::FindTabbedBrowser(profile, true); |
331 | 331 |
332 if (!tabbed_browser) { | 332 if (!tabbed_browser) { |
333 // Set initial bounds so window will not be positioned at an offset | 333 // Set initial bounds so window will not be positioned at an offset |
334 // to this panel as panels are at the bottom of the screen. | 334 // to this panel as panels are at the bottom of the screen. |
335 gfx::Rect window_bounds; | 335 gfx::Rect window_bounds; |
336 WindowSizer::GetBrowserWindowBounds(std::string(), gfx::Rect(), | 336 WindowSizer::GetBrowserWindowBounds(std::string(), gfx::Rect(), |
337 browser_, &window_bounds); | 337 browser_, &window_bounds); |
338 Browser::CreateParams params(Browser::TYPE_TABBED, profile); | 338 Browser::CreateParams params(Browser::TYPE_TABBED, profile); |
339 params.initial_bounds = window_bounds; | 339 params.initial_bounds = window_bounds; |
340 tabbed_browser = Browser::CreateWithParams(params); | 340 tabbed_browser = new Browser(params); |
341 chrome::NewTab(tabbed_browser); | 341 chrome::NewTab(tabbed_browser); |
342 } | 342 } |
343 | 343 |
344 tabbed_browser->window()->Show(); // Ensure download shelf is visible. | 344 tabbed_browser->window()->Show(); // Ensure download shelf is visible. |
345 return tabbed_browser->window()->GetDownloadShelf(); | 345 return tabbed_browser->window()->GetDownloadShelf(); |
346 } | 346 } |
347 | 347 |
348 void PanelBrowserWindow::ConfirmBrowserCloseWithPendingDownloads() { | 348 void PanelBrowserWindow::ConfirmBrowserCloseWithPendingDownloads() { |
349 NOTIMPLEMENTED(); | 349 NOTIMPLEMENTED(); |
350 } | 350 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 } | 484 } |
485 | 485 |
486 void PanelBrowserWindow::TabInsertedAt(TabContents* contents, | 486 void PanelBrowserWindow::TabInsertedAt(TabContents* contents, |
487 int index, | 487 int index, |
488 bool foreground) { | 488 bool foreground) { |
489 if (panel_->auto_resizable()) { | 489 if (panel_->auto_resizable()) { |
490 DCHECK_EQ(0, index); | 490 DCHECK_EQ(0, index); |
491 panel_->EnableWebContentsAutoResize(contents->web_contents()); | 491 panel_->EnableWebContentsAutoResize(contents->web_contents()); |
492 } | 492 } |
493 } | 493 } |
OLD | NEW |