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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 3705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3716 // Download in a constrained popup is shown in the tab that opened it. | 3716 // Download in a constrained popup is shown in the tab that opened it. |
3717 TabContents* constrained_tab = constrained->tab_contents(); | 3717 TabContents* constrained_tab = constrained->tab_contents(); |
3718 constrained_tab->delegate()->OnStartDownload(constrained_tab, download); | 3718 constrained_tab->delegate()->OnStartDownload(constrained_tab, download); |
3719 return; | 3719 return; |
3720 } | 3720 } |
3721 | 3721 |
3722 if (!window()) | 3722 if (!window()) |
3723 return; | 3723 return; |
3724 | 3724 |
3725 if (DisplayOldDownloadsUI()) { | 3725 if (DisplayOldDownloadsUI()) { |
3726 #if defined(USE_AURA) | 3726 #if defined(OS_CHROMEOS) |
3727 // TODO(saintlou): There is no implementation for Aura. | |
3728 #elif defined(OS_CHROMEOS) | |
3729 // Don't show content browser for extension/theme downloads from gallery. | 3727 // Don't show content browser for extension/theme downloads from gallery. |
3730 ExtensionService* service = profile_->GetExtensionService(); | 3728 ExtensionService* service = profile_->GetExtensionService(); |
3731 if (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) || | 3729 if (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) || |
3732 (service == NULL) || | 3730 (service == NULL) || |
3733 !service->IsDownloadFromGallery(download->GetURL(), | 3731 !service->IsDownloadFromGallery(download->GetURL(), |
3734 download->referrer_url())) { | 3732 download->referrer_url())) { |
3735 // Open the Active Downloads ui for chromeos. | 3733 // Open the Active Downloads ui for chromeos. |
3736 ActiveDownloadsUI::OpenPopup(profile_); | 3734 ActiveDownloadsUI::OpenPopup(profile_); |
3737 } | 3735 } |
3738 #else | 3736 #elif !defined(USE_AURA) |
3739 // GetDownloadShelf creates the download shelf if it was not yet created. | 3737 // GetDownloadShelf creates the download shelf if it was not yet created. |
3740 DownloadShelf* shelf = window()->GetDownloadShelf(); | 3738 DownloadShelf* shelf = window()->GetDownloadShelf(); |
3741 shelf->AddDownload(new DownloadItemModel(download)); | 3739 shelf->AddDownload(new DownloadItemModel(download)); |
3742 // Don't show the animation for "Save file" downloads. | 3740 // Don't show the animation for "Save file" downloads. |
3743 // For non-theme extensions, we don't show the download animation. | 3741 // For non-theme extensions, we don't show the download animation. |
3744 // Show animation in same window as the download shelf. Download shelf | 3742 // Show animation in same window as the download shelf. Download shelf |
3745 // may not be in the same window that initiated the download, e.g. | 3743 // may not be in the same window that initiated the download, e.g. |
3746 // Panels. | 3744 // Panels. |
3747 // Don't show the animation if the selected tab is not visible (i.e. the | 3745 // Don't show the animation if the selected tab is not visible (i.e. the |
3748 // window is minimized, we're in a unit test, etc.). | 3746 // window is minimized, we're in a unit test, etc.). |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4429 } | 4427 } |
4430 | 4428 |
4431 gfx::Rect Browser::GetInstantBounds() { | 4429 gfx::Rect Browser::GetInstantBounds() { |
4432 return window()->GetInstantBounds(); | 4430 return window()->GetInstantBounds(); |
4433 } | 4431 } |
4434 | 4432 |
4435 /////////////////////////////////////////////////////////////////////////////// | 4433 /////////////////////////////////////////////////////////////////////////////// |
4436 // Browser, protected: | 4434 // Browser, protected: |
4437 | 4435 |
4438 BrowserWindow* Browser::CreateBrowserWindow() { | 4436 BrowserWindow* Browser::CreateBrowserWindow() { |
4439 #if !defined(OS_CHROMEOS) | 4437 #if !defined(OS_CHROMEOS) || defined(USE_AURA) |
4440 if (type_ == TYPE_PANEL) { | 4438 if (type_ == TYPE_PANEL) { |
4441 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch( | 4439 DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch( |
4442 switches::kDisablePanels)); | 4440 switches::kDisablePanels)); |
4443 return PanelManager::GetInstance()->CreatePanel(this); | 4441 return PanelManager::GetInstance()->CreatePanel(this); |
4444 } | 4442 } |
4445 #endif | 4443 #endif |
4446 | 4444 |
4447 return BrowserWindow::CreateBrowserWindow(this); | 4445 return BrowserWindow::CreateBrowserWindow(this); |
4448 } | 4446 } |
4449 | 4447 |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5509 } | 5507 } |
5510 | 5508 |
5511 void Browser::UpdateFullscreenExitBubbleContent() { | 5509 void Browser::UpdateFullscreenExitBubbleContent() { |
5512 GURL url; | 5510 GURL url; |
5513 if (fullscreened_tab_) | 5511 if (fullscreened_tab_) |
5514 url = fullscreened_tab_->tab_contents()->GetURL(); | 5512 url = fullscreened_tab_->tab_contents()->GetURL(); |
5515 | 5513 |
5516 window_->UpdateFullscreenExitBubbleContent( | 5514 window_->UpdateFullscreenExitBubbleContent( |
5517 url, GetFullscreenExitBubbleType()); | 5515 url, GetFullscreenExitBubbleType()); |
5518 } | 5516 } |
OLD | NEW |