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/task_manager/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/i18n/number_formatting.h" | 8 #include "base/i18n/number_formatting.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 if (!browser) { | 1038 if (!browser) { |
1039 // On OS X, the task manager can be open without any open browser windows. | 1039 // On OS X, the task manager can be open without any open browser windows. |
1040 if (!g_browser_process || !g_browser_process->profile_manager()) | 1040 if (!g_browser_process || !g_browser_process->profile_manager()) |
1041 return; | 1041 return; |
1042 Profile* profile = | 1042 Profile* profile = |
1043 g_browser_process->profile_manager()->GetLastUsedProfile(); | 1043 g_browser_process->profile_manager()->GetLastUsedProfile(); |
1044 if (!profile) | 1044 if (!profile) |
1045 return; | 1045 return; |
1046 browser = Browser::Create(profile); | 1046 browser = Browser::Create(profile); |
1047 browser->OpenURL(GURL(chrome::kChromeUIMemoryURL), GURL(), | 1047 browser->OpenURL(GURL(chrome::kChromeUIMemoryURL), GURL(), |
1048 NEW_FOREGROUND_TAB, PageTransition::LINK); | 1048 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK); |
1049 browser->window()->Show(); | 1049 browser->window()->Show(); |
1050 } else { | 1050 } else { |
1051 browser->OpenURL(GURL(chrome::kChromeUIMemoryURL), GURL(), | 1051 browser->OpenURL(GURL(chrome::kChromeUIMemoryURL), GURL(), |
1052 NEW_FOREGROUND_TAB, PageTransition::LINK); | 1052 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK); |
1053 | 1053 |
1054 // In case the browser window is minimzed, show it. If |browser| is a | 1054 // In case the browser window is minimzed, show it. If |browser| is a |
1055 // non-tabbed window, the call to OpenURL above will have opened a | 1055 // non-tabbed window, the call to OpenURL above will have opened a |
1056 // TabContents in a tabbed browser, so we need to grab it with GetLastActive | 1056 // TabContents in a tabbed browser, so we need to grab it with GetLastActive |
1057 // before the call to show(). | 1057 // before the call to show(). |
1058 if (!browser->is_type_tabbed()) { | 1058 if (!browser->is_type_tabbed()) { |
1059 browser = BrowserList::GetLastActive(); | 1059 browser = BrowserList::GetLastActive(); |
1060 DCHECK(browser); | 1060 DCHECK(browser); |
1061 } | 1061 } |
1062 | 1062 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 // Count the number of extensions with background pages (including | 1121 // Count the number of extensions with background pages (including |
1122 // incognito). | 1122 // incognito). |
1123 count += CountExtensionBackgroundPagesForProfile(profile); | 1123 count += CountExtensionBackgroundPagesForProfile(profile); |
1124 if (profile->HasOffTheRecordProfile()) { | 1124 if (profile->HasOffTheRecordProfile()) { |
1125 count += CountExtensionBackgroundPagesForProfile( | 1125 count += CountExtensionBackgroundPagesForProfile( |
1126 profile->GetOffTheRecordProfile()); | 1126 profile->GetOffTheRecordProfile()); |
1127 } | 1127 } |
1128 } | 1128 } |
1129 return count; | 1129 return count; |
1130 } | 1130 } |
OLD | NEW |