OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser.h" | 5 #include "chrome/browser/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 2950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2961 ++i; | 2961 ++i; |
2962 } | 2962 } |
2963 break; | 2963 break; |
2964 } | 2964 } |
2965 | 2965 |
2966 case NotificationType::BROWSER_THEME_CHANGED: | 2966 case NotificationType::BROWSER_THEME_CHANGED: |
2967 window()->UserChangedTheme(); | 2967 window()->UserChangedTheme(); |
2968 break; | 2968 break; |
2969 | 2969 |
2970 case NotificationType::EXTENSION_READY_FOR_INSTALL: { | 2970 case NotificationType::EXTENSION_READY_FOR_INSTALL: { |
2971 if (BrowserList::GetLastActive() != this) | 2971 // Handle EXTENSION_READY_FOR_INSTALL for last active normal browser. |
| 2972 if (BrowserList::FindBrowserWithType(profile(), |
| 2973 Browser::TYPE_NORMAL, |
| 2974 false) != this) |
2972 break; | 2975 break; |
2973 | 2976 |
2974 // We only want to show the loading dialog for themes, but we don't want | 2977 // We only want to show the loading dialog for themes, but we don't want |
2975 // to wait until unpack to find out an extension is a theme, so we test | 2978 // to wait until unpack to find out an extension is a theme, so we test |
2976 // the download_url GURL instead. This means that themes in the extensions | 2979 // the download_url GURL instead. This means that themes in the extensions |
2977 // gallery won't get the loading dialog. | 2980 // gallery won't get the loading dialog. |
2978 GURL download_url = *(Details<GURL>(details).ptr()); | 2981 GURL download_url = *(Details<GURL>(details).ptr()); |
2979 if (ExtensionsService::IsDownloadFromMiniGallery(download_url)) | 2982 if (ExtensionsService::IsDownloadFromMiniGallery(download_url)) |
2980 window()->ShowThemeInstallBubble(); | 2983 window()->ShowThemeInstallBubble(); |
2981 break; | 2984 break; |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3924 } | 3927 } |
3925 | 3928 |
3926 bool Browser::IsPinned(TabContents* source) { | 3929 bool Browser::IsPinned(TabContents* source) { |
3927 int index = tabstrip_model_.GetIndexOfTabContents(source); | 3930 int index = tabstrip_model_.GetIndexOfTabContents(source); |
3928 if (index == TabStripModel::kNoTab) { | 3931 if (index == TabStripModel::kNoTab) { |
3929 NOTREACHED() << "IsPinned called for tab not in our strip"; | 3932 NOTREACHED() << "IsPinned called for tab not in our strip"; |
3930 return false; | 3933 return false; |
3931 } | 3934 } |
3932 return tabstrip_model_.IsTabPinned(index); | 3935 return tabstrip_model_.IsTabPinned(index); |
3933 } | 3936 } |
OLD | NEW |