| 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/common/localized_error.h" | 5 #include "chrome/common/localized_error.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 error_code); | 447 error_code); |
| 448 DCHECK(map); | 448 DCHECK(map); |
| 449 return map; | 449 return map; |
| 450 } else { | 450 } else { |
| 451 NOTREACHED(); | 451 NOTREACHED(); |
| 452 return NULL; | 452 return NULL; |
| 453 } | 453 } |
| 454 } | 454 } |
| 455 | 455 |
| 456 bool LocaleIsRTL() { | 456 bool LocaleIsRTL() { |
| 457 #if defined(TOOLKIT_GTK) | |
| 458 // base::i18n::IsRTL() uses the GTK text direction, which doesn't work within | |
| 459 // the renderer sandbox. | |
| 460 return base::i18n::ICUIsRTL(); | |
| 461 #else | |
| 462 return base::i18n::IsRTL(); | 457 return base::i18n::IsRTL(); |
| 463 #endif | |
| 464 } | 458 } |
| 465 | 459 |
| 466 // Returns a dictionary containing the strings for the settings menu under the | 460 // Returns a dictionary containing the strings for the settings menu under the |
| 467 // wrench, and the advanced settings button. | 461 // wrench, and the advanced settings button. |
| 468 base::DictionaryValue* GetStandardMenuItemsText() { | 462 base::DictionaryValue* GetStandardMenuItemsText() { |
| 469 base::DictionaryValue* standard_menu_items_text = new base::DictionaryValue(); | 463 base::DictionaryValue* standard_menu_items_text = new base::DictionaryValue(); |
| 470 standard_menu_items_text->SetString("settingsTitle", | 464 standard_menu_items_text->SetString("settingsTitle", |
| 471 l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE)); | 465 l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE)); |
| 472 standard_menu_items_text->SetString("advancedTitle", | 466 standard_menu_items_text->SetString("advancedTitle", |
| 473 l10n_util::GetStringUTF16(IDS_SETTINGS_SHOW_ADVANCED_SETTINGS)); | 467 l10n_util::GetStringUTF16(IDS_SETTINGS_SHOW_ADVANCED_SETTINGS)); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 #if defined(OS_CHROMEOS) | 817 #if defined(OS_CHROMEOS) |
| 824 GURL learn_more_url(kAppWarningLearnMoreUrl); | 818 GURL learn_more_url(kAppWarningLearnMoreUrl); |
| 825 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue(); | 819 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue(); |
| 826 suggest_learn_more->SetString("msg", | 820 suggest_learn_more->SetString("msg", |
| 827 l10n_util::GetStringUTF16( | 821 l10n_util::GetStringUTF16( |
| 828 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); | 822 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); |
| 829 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); | 823 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); |
| 830 error_strings->Set("suggestionsLearnMore", suggest_learn_more); | 824 error_strings->Set("suggestionsLearnMore", suggest_learn_more); |
| 831 #endif // defined(OS_CHROMEOS) | 825 #endif // defined(OS_CHROMEOS) |
| 832 } | 826 } |
| OLD | NEW |