| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/toolbar/origin_chip_info.h" | 5 #include "chrome/browser/ui/toolbar/origin_chip_info.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/extension_icon_image.h" | 10 #include "chrome/browser/extensions/extension_icon_image.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // TODO(gbillock): Just get the page title and special case exceptions? | 42 // TODO(gbillock): Just get the page title and special case exceptions? |
| 43 std::string host = url.host(); | 43 std::string host = url.host(); |
| 44 if (host == chrome::kChromeUIAppLauncherPageHost) | 44 if (host == chrome::kChromeUIAppLauncherPageHost) |
| 45 return IDS_APP_DEFAULT_PAGE_NAME; | 45 return IDS_APP_DEFAULT_PAGE_NAME; |
| 46 if (host == chrome::kChromeUIBookmarksHost) | 46 if (host == chrome::kChromeUIBookmarksHost) |
| 47 return IDS_BOOKMARK_MANAGER_TITLE; | 47 return IDS_BOOKMARK_MANAGER_TITLE; |
| 48 if (host == chrome::kChromeUIComponentsHost) | 48 if (host == chrome::kChromeUIComponentsHost) |
| 49 return IDS_COMPONENTS_TITLE; | 49 return IDS_COMPONENTS_TITLE; |
| 50 if (host == chrome::kChromeUICrashesHost) | 50 if (host == chrome::kChromeUICrashesHost) |
| 51 return IDS_CRASHES_TITLE; | 51 return IDS_CRASHES_TITLE; |
| 52 #if defined(ENABLE_MDNS) | 52 #if defined(ENABLE_SERVICE_DISCOVERY) |
| 53 if (host == chrome::kChromeUIDevicesHost) | 53 if (host == chrome::kChromeUIDevicesHost) |
| 54 return IDS_LOCAL_DISCOVERY_DEVICES_PAGE_TITLE; | 54 return IDS_LOCAL_DISCOVERY_DEVICES_PAGE_TITLE; |
| 55 #endif // ENABLE_MDNS | 55 #endif // ENABLE_SERVICE_DISCOVERY |
| 56 if (host == chrome::kChromeUIDownloadsHost) | 56 if (host == chrome::kChromeUIDownloadsHost) |
| 57 return IDS_DOWNLOAD_TITLE; | 57 return IDS_DOWNLOAD_TITLE; |
| 58 if (host == chrome::kChromeUIExtensionsHost) | 58 if (host == chrome::kChromeUIExtensionsHost) |
| 59 return IDS_MANAGE_EXTENSIONS_SETTING_WINDOWS_TITLE; | 59 return IDS_MANAGE_EXTENSIONS_SETTING_WINDOWS_TITLE; |
| 60 if (host == chrome::kChromeUIHelpHost) | 60 if (host == chrome::kChromeUIHelpHost) |
| 61 return IDS_ABOUT_TAB_TITLE; | 61 return IDS_ABOUT_TAB_TITLE; |
| 62 if (host == chrome::kChromeUIHistoryHost) | 62 if (host == chrome::kChromeUIHistoryHost) |
| 63 return IDS_HISTORY_TITLE; | 63 return IDS_HISTORY_TITLE; |
| 64 if (host == chrome::kChromeUINewTabHost) | 64 if (host == chrome::kChromeUINewTabHost) |
| 65 return IDS_NEW_TAB_TITLE; | 65 return IDS_NEW_TAB_TITLE; |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 #if defined(OS_CHROMEOS) | 238 #if defined(OS_CHROMEOS) |
| 239 if (url.SchemeIs(chrome::kCrosScheme) || | 239 if (url.SchemeIs(chrome::kCrosScheme) || |
| 240 url.SchemeIs(chrome::kDriveScheme)) | 240 url.SchemeIs(chrome::kDriveScheme)) |
| 241 return base::UTF8ToUTF16(url.spec()); | 241 return base::UTF8ToUTF16(url.spec()); |
| 242 #endif | 242 #endif |
| 243 | 243 |
| 244 // If all else fails, return the hostname. | 244 // If all else fails, return the hostname. |
| 245 return base::UTF8ToUTF16(url.host()); | 245 return base::UTF8ToUTF16(url.host()); |
| 246 } | 246 } |
| OLD | NEW |