| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "chrome/browser/ui/panels/panel.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/extensions/extension_prefs.h" | 8 #include "chrome/browser/extensions/extension_prefs.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 | 384 |
| 385 DownloadShelf* Panel::GetDownloadShelf() { | 385 DownloadShelf* Panel::GetDownloadShelf() { |
| 386 Browser* panel_browser = native_panel_->GetPanelBrowser(); | 386 Browser* panel_browser = native_panel_->GetPanelBrowser(); |
| 387 Profile* profile = panel_browser->GetProfile(); | 387 Profile* profile = panel_browser->GetProfile(); |
| 388 Browser* tabbed_browser = Browser::GetTabbedBrowser(profile, true); | 388 Browser* tabbed_browser = Browser::GetTabbedBrowser(profile, true); |
| 389 | 389 |
| 390 if (!tabbed_browser) { | 390 if (!tabbed_browser) { |
| 391 // Set initial bounds so window will not be positioned at an offset | 391 // Set initial bounds so window will not be positioned at an offset |
| 392 // to this panel as panels are at the bottom of the screen. | 392 // to this panel as panels are at the bottom of the screen. |
| 393 gfx::Rect window_bounds; | 393 gfx::Rect window_bounds; |
| 394 bool maximized; | 394 WindowSizer::GetBrowserWindowBounds(std::string(), gfx::Rect(), |
| 395 WindowSizer::GetBrowserWindowBounds( | 395 panel_browser, &window_bounds); |
| 396 std::string(), gfx::Rect(), panel_browser, &window_bounds, &maximized); | |
| 397 Browser::CreateParams params(Browser::TYPE_TABBED, profile); | 396 Browser::CreateParams params(Browser::TYPE_TABBED, profile); |
| 398 params.initial_bounds = window_bounds; | 397 params.initial_bounds = window_bounds; |
| 399 tabbed_browser = Browser::CreateWithParams(params); | 398 tabbed_browser = Browser::CreateWithParams(params); |
| 400 tabbed_browser->NewTab(); | 399 tabbed_browser->NewTab(); |
| 401 } | 400 } |
| 402 | 401 |
| 403 tabbed_browser->window()->Show(); // Ensure download shelf is visible. | 402 tabbed_browser->window()->Show(); // Ensure download shelf is visible. |
| 404 return tabbed_browser->window()->GetDownloadShelf(); | 403 return tabbed_browser->window()->GetDownloadShelf(); |
| 405 } | 404 } |
| 406 | 405 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 RequestRenderViewHostToDisableScrollbars(render_view_host); | 596 RequestRenderViewHostToDisableScrollbars(render_view_host); |
| 598 } | 597 } |
| 599 | 598 |
| 600 Browser* Panel::browser() const { | 599 Browser* Panel::browser() const { |
| 601 return native_panel_->GetPanelBrowser(); | 600 return native_panel_->GetPanelBrowser(); |
| 602 } | 601 } |
| 603 | 602 |
| 604 void Panel::DestroyBrowser() { | 603 void Panel::DestroyBrowser() { |
| 605 native_panel_->DestroyPanelBrowser(); | 604 native_panel_->DestroyPanelBrowser(); |
| 606 } | 605 } |
| OLD | NEW |