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/options/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "chrome/browser/signin/signin_manager_factory.h" | 42 #include "chrome/browser/signin/signin_manager_factory.h" |
43 #include "chrome/browser/sync/profile_sync_service.h" | 43 #include "chrome/browser/sync/profile_sync_service.h" |
44 #include "chrome/browser/sync/profile_sync_service_factory.h" | 44 #include "chrome/browser/sync/profile_sync_service_factory.h" |
45 #include "chrome/browser/sync/sync_ui_util.h" | 45 #include "chrome/browser/sync/sync_ui_util.h" |
46 #include "chrome/browser/themes/theme_service.h" | 46 #include "chrome/browser/themes/theme_service.h" |
47 #include "chrome/browser/themes/theme_service_factory.h" | 47 #include "chrome/browser/themes/theme_service_factory.h" |
48 #include "chrome/browser/ui/browser_finder.h" | 48 #include "chrome/browser/ui/browser_finder.h" |
49 #include "chrome/browser/ui/chrome_select_file_policy.h" | 49 #include "chrome/browser/ui/chrome_select_file_policy.h" |
50 #include "chrome/browser/ui/host_desktop.h" | 50 #include "chrome/browser/ui/host_desktop.h" |
51 #include "chrome/browser/ui/options/options_util.h" | 51 #include "chrome/browser/ui/options/options_util.h" |
| 52 #include "chrome/browser/ui/search/search.h" |
52 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 53 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
53 #include "chrome/browser/ui/webui/favicon_source.h" | 54 #include "chrome/browser/ui/webui/favicon_source.h" |
54 #include "chrome/browser/ui/webui/web_ui_util.h" | 55 #include "chrome/browser/ui/webui/web_ui_util.h" |
55 #include "chrome/common/chrome_constants.h" | 56 #include "chrome/common/chrome_constants.h" |
56 #include "chrome/common/chrome_notification_types.h" | 57 #include "chrome/common/chrome_notification_types.h" |
57 #include "chrome/common/chrome_paths.h" | 58 #include "chrome/common/chrome_paths.h" |
58 #include "chrome/common/chrome_switches.h" | 59 #include "chrome/common/chrome_switches.h" |
59 #include "chrome/common/pref_names.h" | 60 #include "chrome/common/pref_names.h" |
60 #include "chrome/common/url_constants.h" | 61 #include "chrome/common/url_constants.h" |
61 #include "content/public/browser/browser_thread.h" | 62 #include "content/public/browser/browser_thread.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE); | 387 IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE); |
387 RegisterCloudPrintValues(values); | 388 RegisterCloudPrintValues(values); |
388 | 389 |
389 values->SetString("syncLearnMoreURL", chrome::kSyncLearnMoreURL); | 390 values->SetString("syncLearnMoreURL", chrome::kSyncLearnMoreURL); |
390 string16 omnibox_url = ASCIIToUTF16(chrome::kOmniboxLearnMoreURL); | 391 string16 omnibox_url = ASCIIToUTF16(chrome::kOmniboxLearnMoreURL); |
391 values->SetString( | 392 values->SetString( |
392 "defaultSearchGroupLabel", | 393 "defaultSearchGroupLabel", |
393 l10n_util::GetStringFUTF16(IDS_SEARCH_PREF_EXPLANATION, omnibox_url)); | 394 l10n_util::GetStringFUTF16(IDS_SEARCH_PREF_EXPLANATION, omnibox_url)); |
394 | 395 |
395 string16 instant_learn_more_url = ASCIIToUTF16(chrome::kInstantLearnMoreURL); | 396 string16 instant_learn_more_url = ASCIIToUTF16(chrome::kInstantLearnMoreURL); |
| 397 int instant_message_id = IDS_INSTANT_PREF_WITH_WARNING; |
| 398 if (chrome::search::IsInstantExtendedAPIEnabled( |
| 399 Profile::FromWebUI(web_ui()))) { |
| 400 instant_message_id = IDS_INSTANT_EXTENDED_PREF_WITH_WARNING; |
| 401 values->SetString("instant_enabled", "instant_extended.enabled"); |
| 402 } else { |
| 403 values->SetString("instant_enabled", "instant.enabled"); |
| 404 } |
396 values->SetString( | 405 values->SetString( |
397 "instantPrefAndWarning", | 406 "instantPrefAndWarning", |
398 l10n_util::GetStringFUTF16(IDS_INSTANT_PREF_WITH_WARNING, | 407 l10n_util::GetStringFUTF16(instant_message_id, instant_learn_more_url)); |
399 instant_learn_more_url)); | |
400 values->SetString("instantLearnMoreLink", instant_learn_more_url); | 408 values->SetString("instantLearnMoreLink", instant_learn_more_url); |
401 | 409 |
402 #if defined(OS_CHROMEOS) | 410 #if defined(OS_CHROMEOS) |
403 const chromeos::User* user = chromeos::UserManager::Get()->GetLoggedInUser(); | 411 const chromeos::User* user = chromeos::UserManager::Get()->GetLoggedInUser(); |
404 values->SetString("username", user ? user->email() : std::string()); | 412 values->SetString("username", user ? user->email() : std::string()); |
405 #endif | 413 #endif |
406 | 414 |
407 // Pass along sync status early so it will be available during page init. | 415 // Pass along sync status early so it will be available during page init. |
408 values->Set("syncData", GetSyncStateDictionary().release()); | 416 values->Set("syncData", GetSyncStateDictionary().release()); |
409 | 417 |
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 1430 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
1423 } | 1431 } |
1424 StringValue label(label_str); | 1432 StringValue label(label_str); |
1425 | 1433 |
1426 web_ui()->CallJavascriptFunction( | 1434 web_ui()->CallJavascriptFunction( |
1427 "BrowserOptions.setupProxySettingsSection", disabled, label); | 1435 "BrowserOptions.setupProxySettingsSection", disabled, label); |
1428 #endif // !defined(OS_CHROMEOS) | 1436 #endif // !defined(OS_CHROMEOS) |
1429 } | 1437 } |
1430 | 1438 |
1431 } // namespace options | 1439 } // namespace options |
OLD | NEW |