| 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 l10n_util::GetString(IDS_BROWSER_WINDOW_MAC_TAB_UNTITLED); | 69 return UTF16ToWideHack( |
| 70 l10n_util::GetStringUTF16(IDS_BROWSER_WINDOW_MAC_TAB_UNTITLED)); |
| 71 } |
| 70 return page_title; | 72 return page_title; |
| 71 #else | 73 #else |
| 72 if (page_title.empty()) | 74 if (page_title.empty()) |
| 73 return l10n_util::GetString(IDS_PRODUCT_NAME); | 75 return UTF16ToWideHack(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 74 | 76 |
| 75 return l10n_util::GetStringF(IDS_BROWSER_WINDOW_TITLE_FORMAT, page_title); | 77 return UTF16ToWideHack( |
| 78 l10n_util::GetStringFUTF16(IDS_BROWSER_WINDOW_TITLE_FORMAT, |
| 79 WideToUTF16Hack(page_title))); |
| 76 #endif | 80 #endif |
| 77 } | 81 } |
| 78 | 82 |
| 79 // Returns the number of active RenderProcessHosts. | 83 // Returns the number of active RenderProcessHosts. |
| 80 int CountRenderProcessHosts() { | 84 int CountRenderProcessHosts() { |
| 81 int result = 0; | 85 int result = 0; |
| 82 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 86 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
| 83 !i.IsAtEnd(); i.Advance()) | 87 !i.IsAtEnd(); i.Advance()) |
| 84 ++result; | 88 ++result; |
| 85 return result; | 89 return result; |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 | 734 |
| 731 // The normal browser should now have four. | 735 // The normal browser should now have four. |
| 732 EXPECT_EQ(4, browser()->tab_count()); | 736 EXPECT_EQ(4, browser()->tab_count()); |
| 733 | 737 |
| 734 // Close the additional browsers. | 738 // Close the additional browsers. |
| 735 popup_browser->CloseAllTabs(); | 739 popup_browser->CloseAllTabs(); |
| 736 app_browser->CloseAllTabs(); | 740 app_browser->CloseAllTabs(); |
| 737 app_popup_browser->CloseAllTabs(); | 741 app_popup_browser->CloseAllTabs(); |
| 738 } | 742 } |
| 739 #endif | 743 #endif |
| OLD | NEW |