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 30 matching lines...) Expand all Loading... | |
41 #include "chrome/browser/search_engines/template_url_service_factory.h" | 41 #include "chrome/browser/search_engines/template_url_service_factory.h" |
42 #include "chrome/browser/service/service_process_control.h" | 42 #include "chrome/browser/service/service_process_control.h" |
43 #include "chrome/browser/signin/signin_manager.h" | 43 #include "chrome/browser/signin/signin_manager.h" |
44 #include "chrome/browser/signin/signin_manager_factory.h" | 44 #include "chrome/browser/signin/signin_manager_factory.h" |
45 #include "chrome/browser/sync/profile_sync_service.h" | 45 #include "chrome/browser/sync/profile_sync_service.h" |
46 #include "chrome/browser/sync/profile_sync_service_factory.h" | 46 #include "chrome/browser/sync/profile_sync_service_factory.h" |
47 #include "chrome/browser/sync/sync_ui_util.h" | 47 #include "chrome/browser/sync/sync_ui_util.h" |
48 #include "chrome/browser/themes/theme_service.h" | 48 #include "chrome/browser/themes/theme_service.h" |
49 #include "chrome/browser/themes/theme_service_factory.h" | 49 #include "chrome/browser/themes/theme_service_factory.h" |
50 #include "chrome/browser/ui/browser_finder.h" | 50 #include "chrome/browser/ui/browser_finder.h" |
51 #include "chrome/browser/ui/browser_instant_controller.h" | |
51 #include "chrome/browser/ui/chrome_select_file_policy.h" | 52 #include "chrome/browser/ui/chrome_select_file_policy.h" |
52 #include "chrome/browser/ui/host_desktop.h" | 53 #include "chrome/browser/ui/host_desktop.h" |
53 #include "chrome/browser/ui/options/options_util.h" | 54 #include "chrome/browser/ui/options/options_util.h" |
54 #include "chrome/browser/ui/search/search.h" | 55 #include "chrome/browser/ui/search/search.h" |
55 #include "chrome/browser/ui/webui/favicon_source.h" | 56 #include "chrome/browser/ui/webui/favicon_source.h" |
56 #include "chrome/common/chrome_constants.h" | 57 #include "chrome/common/chrome_constants.h" |
57 #include "chrome/common/chrome_notification_types.h" | 58 #include "chrome/common/chrome_notification_types.h" |
58 #include "chrome/common/chrome_paths.h" | 59 #include "chrome/common/chrome_paths.h" |
59 #include "chrome/common/chrome_switches.h" | 60 #include "chrome/common/chrome_switches.h" |
60 #include "chrome/common/pref_names.h" | 61 #include "chrome/common/pref_names.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
409 | 410 |
410 string16 instant_learn_more_url = ASCIIToUTF16(chrome::kInstantLearnMoreURL); | 411 string16 instant_learn_more_url = ASCIIToUTF16(chrome::kInstantLearnMoreURL); |
411 int instant_message_id = IDS_INSTANT_PREF_WITH_WARNING; | 412 int instant_message_id = IDS_INSTANT_PREF_WITH_WARNING; |
412 if (chrome::search::IsInstantExtendedAPIEnabled( | 413 if (chrome::search::IsInstantExtendedAPIEnabled( |
413 Profile::FromWebUI(web_ui()))) { | 414 Profile::FromWebUI(web_ui()))) { |
414 instant_message_id = IDS_INSTANT_EXTENDED_PREF_WITH_WARNING; | 415 instant_message_id = IDS_INSTANT_EXTENDED_PREF_WITH_WARNING; |
415 values->SetString("instant_enabled", "instant_extended.enabled"); | 416 values->SetString("instant_enabled", "instant_extended.enabled"); |
416 } else { | 417 } else { |
417 values->SetString("instant_enabled", "instant.enabled"); | 418 values->SetString("instant_enabled", "instant.enabled"); |
418 } | 419 } |
420 // This is needed because in the instant extended case, | |
421 // search::GetInstantExtendedDefaultSetting may say | |
422 // INSTANT_USE_EXISTING, which means use the current value of | |
423 // kInstantEnabled. See browser_options.js for where we set the | |
424 // checkbox to this value. | |
425 // | |
426 // We do this both in the instant extended case and in the regular | |
427 // case so that there is less difference between code paths. | |
428 values->SetBoolean("instant_starting_value", | |
429 chrome::BrowserInstantController::IsInstantEnabled( | |
430 Profile::FromWebUI(web_ui()))); | |
Mattias Nissler (ping if slow)
2013/02/25 18:53:41
I think this is not needed, but you just have to f
| |
419 values->SetString( | 431 values->SetString( |
420 "instantPrefAndWarning", | 432 "instantPrefAndWarning", |
421 l10n_util::GetStringFUTF16(instant_message_id, instant_learn_more_url)); | 433 l10n_util::GetStringFUTF16(instant_message_id, instant_learn_more_url)); |
422 values->SetString("instantLearnMoreLink", instant_learn_more_url); | 434 values->SetString("instantLearnMoreLink", instant_learn_more_url); |
423 | 435 |
424 #if defined(OS_CHROMEOS) | 436 #if defined(OS_CHROMEOS) |
425 const chromeos::User* user = chromeos::UserManager::Get()->GetLoggedInUser(); | 437 const chromeos::User* user = chromeos::UserManager::Get()->GetLoggedInUser(); |
426 values->SetString("username", user ? user->email() : std::string()); | 438 values->SetString("username", user ? user->email() : std::string()); |
427 #endif | 439 #endif |
428 | 440 |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1460 base::FundamentalValue disabled(proxy_prefs_.IsManaged() || | 1472 base::FundamentalValue disabled(proxy_prefs_.IsManaged() || |
1461 is_extension_controlled); | 1473 is_extension_controlled); |
1462 base::FundamentalValue extension_controlled(is_extension_controlled); | 1474 base::FundamentalValue extension_controlled(is_extension_controlled); |
1463 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection", | 1475 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection", |
1464 disabled, extension_controlled); | 1476 disabled, extension_controlled); |
1465 | 1477 |
1466 #endif // !defined(OS_CHROMEOS) | 1478 #endif // !defined(OS_CHROMEOS) |
1467 } | 1479 } |
1468 | 1480 |
1469 } // namespace options | 1481 } // namespace options |
OLD | NEW |