| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 const FilePath::CharType* kTitle1File = FILE_PATH_LITERAL("title1.html"); | 58 const FilePath::CharType* kTitle1File = FILE_PATH_LITERAL("title1.html"); |
| 59 const FilePath::CharType* kTitle2File = FILE_PATH_LITERAL("title2.html"); | 59 const FilePath::CharType* kTitle2File = FILE_PATH_LITERAL("title2.html"); |
| 60 | 60 |
| 61 const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); | 61 const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); |
| 62 | 62 |
| 63 // Given a page title, returns the expected window caption string. | 63 // Given a page title, returns the expected window caption string. |
| 64 std::wstring WindowCaptionFromPageTitle(std::wstring page_title) { | 64 std::wstring WindowCaptionFromPageTitle(std::wstring page_title) { |
| 65 #if defined(OS_MACOSX) || defined(OS_CHROMEOS) | 65 #if defined(OS_MACOSX) || defined(OS_CHROMEOS) |
| 66 // On Mac or ChromeOS, we don't want to suffix the page title with | 66 // On Mac or ChromeOS, we don't want to suffix the page title with |
| 67 // the application name. | 67 // the application name. |
| 68 if (page_title.empty()) { | 68 if (page_title.empty()) |
| 69 return UTF16ToWideHack( | 69 return l10n_util::GetString(IDS_BROWSER_WINDOW_MAC_TAB_UNTITLED); |
| 70 l10n_util::GetStringUTF16(IDS_BROWSER_WINDOW_MAC_TAB_UNTITLED)); | |
| 71 } | |
| 72 return page_title; | 70 return page_title; |
| 73 #else | 71 #else |
| 74 if (page_title.empty()) | 72 if (page_title.empty()) |
| 75 return UTF16ToWideHack(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 73 return l10n_util::GetString(IDS_PRODUCT_NAME); |
| 76 | 74 |
| 77 return UTF16ToWideHack( | 75 return l10n_util::GetStringF(IDS_BROWSER_WINDOW_TITLE_FORMAT, page_title); |
| 78 l10n_util::GetStringFUTF16(IDS_BROWSER_WINDOW_TITLE_FORMAT, | |
| 79 WideToUTF16Hack(page_title))); | |
| 80 #endif | 76 #endif |
| 81 } | 77 } |
| 82 | 78 |
| 83 // Returns the number of active RenderProcessHosts. | 79 // Returns the number of active RenderProcessHosts. |
| 84 int CountRenderProcessHosts() { | 80 int CountRenderProcessHosts() { |
| 85 int result = 0; | 81 int result = 0; |
| 86 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 82 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
| 87 !i.IsAtEnd(); i.Advance()) | 83 !i.IsAtEnd(); i.Advance()) |
| 88 ++result; | 84 ++result; |
| 89 return result; | 85 return result; |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 | 730 |
| 735 // The normal browser should now have four. | 731 // The normal browser should now have four. |
| 736 EXPECT_EQ(4, browser()->tab_count()); | 732 EXPECT_EQ(4, browser()->tab_count()); |
| 737 | 733 |
| 738 // Close the additional browsers. | 734 // Close the additional browsers. |
| 739 popup_browser->CloseAllTabs(); | 735 popup_browser->CloseAllTabs(); |
| 740 app_browser->CloseAllTabs(); | 736 app_browser->CloseAllTabs(); |
| 741 app_popup_browser->CloseAllTabs(); | 737 app_popup_browser->CloseAllTabs(); |
| 742 } | 738 } |
| 743 #endif | 739 #endif |
| OLD | NEW |