OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webui/ntp/ntp_resource_cache.h" | 5 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 new_tab_html_ = NULL; | 259 new_tab_html_ = NULL; |
260 } else { | 260 } else { |
261 NOTREACHED(); | 261 NOTREACHED(); |
262 } | 262 } |
263 } | 263 } |
264 | 264 |
265 void NTPResourceCache::CreateNewTabIncognitoHTML() { | 265 void NTPResourceCache::CreateNewTabIncognitoHTML() { |
266 DictionaryValue localized_strings; | 266 DictionaryValue localized_strings; |
267 localized_strings.SetString("title", | 267 localized_strings.SetString("title", |
268 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); | 268 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); |
269 int new_tab_message_ids = IDS_NEW_TAB_OTR_MESSAGE; | 269 int new_tab_message_ids = IDS_NEW_TAB_INCOGNITO_MESSAGE; |
270 int new_tab_html_idr = IDR_INCOGNITO_TAB_HTML; | 270 int new_tab_html_idr = IDR_INCOGNITO_TAB_HTML; |
271 const char* new_tab_link = kLearnMoreIncognitoUrl; | 271 const char* new_tab_link = kLearnMoreIncognitoUrl; |
272 // TODO(altimofeev): consider implementation without 'if def' usage. | 272 // TODO(altimofeev): consider implementation without 'if def' usage. |
273 #if defined(OS_CHROMEOS) | 273 #if defined(OS_CHROMEOS) |
274 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { | 274 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { |
275 new_tab_message_ids = IDS_NEW_TAB_GUEST_SESSION_MESSAGE; | 275 new_tab_message_ids = IDS_NEW_TAB_GUEST_SESSION_MESSAGE; |
276 new_tab_html_idr = IDR_GUEST_SESSION_TAB_HTML; | 276 new_tab_html_idr = IDR_GUEST_SESSION_TAB_HTML; |
277 new_tab_link = kLearnMoreGuestSessionUrl; | 277 new_tab_link = kLearnMoreGuestSessionUrl; |
278 } | 278 } |
279 #endif | 279 #endif |
280 localized_strings.SetString("content", | 280 localized_strings.SetString("content", |
281 l10n_util::GetStringFUTF16(new_tab_message_ids, | 281 l10n_util::GetStringFUTF16(new_tab_message_ids, |
282 GetUrlWithLang(GURL(new_tab_link)))); | 282 GetUrlWithLang(GURL(new_tab_link)))); |
283 localized_strings.SetString("extensionsmessage", | 283 localized_strings.SetString("extensionsmessage", |
284 l10n_util::GetStringFUTF16( | 284 l10n_util::GetStringFUTF16( |
285 IDS_NEW_TAB_OTR_EXTENSIONS_MESSAGE, | 285 IDS_NEW_TAB_INCOGNITO_EXTENSIONS_MESSAGE, |
286 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | |
287 ASCIIToUTF16(chrome::kChromeUIExtensionsURL))); | 286 ASCIIToUTF16(chrome::kChromeUIExtensionsURL))); |
288 bool bookmark_bar_attached = profile_->GetPrefs()->GetBoolean( | 287 bool bookmark_bar_attached = profile_->GetPrefs()->GetBoolean( |
289 prefs::kShowBookmarkBar); | 288 prefs::kShowBookmarkBar); |
290 localized_strings.SetString("bookmarkbarattached", | 289 localized_strings.SetString("bookmarkbarattached", |
291 bookmark_bar_attached ? "true" : "false"); | 290 bookmark_bar_attached ? "true" : "false"); |
292 | 291 |
293 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); | 292 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); |
294 | 293 |
295 static const base::StringPiece incognito_tab_html( | 294 static const base::StringPiece incognito_tab_html( |
296 ResourceBundle::GetSharedInstance().GetRawDataResource( | 295 ResourceBundle::GetSharedInstance().GetRawDataResource( |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 // Get our template. | 577 // Get our template. |
579 static const base::StringPiece new_tab_theme_css( | 578 static const base::StringPiece new_tab_theme_css( |
580 ResourceBundle::GetSharedInstance().GetRawDataResource( | 579 ResourceBundle::GetSharedInstance().GetRawDataResource( |
581 IDR_NEW_TAB_4_THEME_CSS)); | 580 IDR_NEW_TAB_4_THEME_CSS)); |
582 | 581 |
583 // Create the string from our template and the replacements. | 582 // Create the string from our template and the replacements. |
584 std::string css_string; | 583 std::string css_string; |
585 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 584 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
586 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 585 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
587 } | 586 } |
OLD | NEW |