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.h" | 5 #include "chrome/browser/ui/panels/panel.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/browser_finder.h" |
11 #include "chrome/browser/ui/panels/native_panel.h" | 12 #include "chrome/browser/ui/panels/native_panel.h" |
12 #include "chrome/browser/ui/panels/panel_manager.h" | 13 #include "chrome/browser/ui/panels/panel_manager.h" |
13 #include "chrome/browser/ui/panels/panel_strip.h" | 14 #include "chrome/browser/ui/panels/panel_strip.h" |
14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
16 #include "chrome/browser/ui/window_sizer.h" | 17 #include "chrome/browser/ui/window_sizer.h" |
17 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
18 #include "content/public/browser/notification_service.h" | 19 #include "content/public/browser/notification_service.h" |
19 #include "content/public/browser/notification_source.h" | 20 #include "content/public/browser/notification_source.h" |
20 #include "content/public/browser/notification_types.h" | 21 #include "content/public/browser/notification_types.h" |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 } | 524 } |
524 #endif | 525 #endif |
525 | 526 |
526 bool Panel::IsDownloadShelfVisible() const { | 527 bool Panel::IsDownloadShelfVisible() const { |
527 return false; | 528 return false; |
528 } | 529 } |
529 | 530 |
530 DownloadShelf* Panel::GetDownloadShelf() { | 531 DownloadShelf* Panel::GetDownloadShelf() { |
531 Browser* panel_browser = native_panel_->GetPanelBrowser(); | 532 Browser* panel_browser = native_panel_->GetPanelBrowser(); |
532 Profile* profile = panel_browser->profile(); | 533 Profile* profile = panel_browser->profile(); |
533 Browser* tabbed_browser = Browser::GetTabbedBrowser(profile, true); | 534 Browser* tabbed_browser = browser::FindTabbedBrowser(profile, true); |
534 | 535 |
535 if (!tabbed_browser) { | 536 if (!tabbed_browser) { |
536 // Set initial bounds so window will not be positioned at an offset | 537 // Set initial bounds so window will not be positioned at an offset |
537 // to this panel as panels are at the bottom of the screen. | 538 // to this panel as panels are at the bottom of the screen. |
538 gfx::Rect window_bounds; | 539 gfx::Rect window_bounds; |
539 WindowSizer::GetBrowserWindowBounds(std::string(), gfx::Rect(), | 540 WindowSizer::GetBrowserWindowBounds(std::string(), gfx::Rect(), |
540 panel_browser, &window_bounds); | 541 panel_browser, &window_bounds); |
541 Browser::CreateParams params(Browser::TYPE_TABBED, profile); | 542 Browser::CreateParams params(Browser::TYPE_TABBED, profile); |
542 params.initial_bounds = window_bounds; | 543 params.initial_bounds = window_bounds; |
543 tabbed_browser = Browser::CreateWithParams(params); | 544 tabbed_browser = Browser::CreateWithParams(params); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 max_size_policy_ = CUSTOM_MAX_SIZE; | 787 max_size_policy_ = CUSTOM_MAX_SIZE; |
787 } | 788 } |
788 | 789 |
789 void Panel::OnPanelEndUserResizing() { | 790 void Panel::OnPanelEndUserResizing() { |
790 SetPreviewMode(false); | 791 SetPreviewMode(false); |
791 } | 792 } |
792 | 793 |
793 void Panel::DestroyBrowser() { | 794 void Panel::DestroyBrowser() { |
794 native_panel_->DestroyPanelBrowser(); | 795 native_panel_->DestroyPanelBrowser(); |
795 } | 796 } |
OLD | NEW |