NaCl: Update revision in DEPS, r12770 -> r12773
[chromium-blink-merge.git] / chrome / browser / ui / webui / options / geolocation_options_handler.cc
blobc9673a9ee7b4cbb097d28a6a3a6984086e7a4871
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/webui/options/geolocation_options_handler.h"
7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h"
9 #include "chrome/common/chrome_switches.h"
10 #include "content/public/browser/web_ui.h"
12 namespace options {
14 GeolocationOptionsHandler::GeolocationOptionsHandler() {}
16 GeolocationOptionsHandler::~GeolocationOptionsHandler() {}
18 void GeolocationOptionsHandler::GetLocalizedValues(
19 base::DictionaryValue* localized_strings) {
22 void GeolocationOptionsHandler::InitializePage() {
23 DCHECK(web_ui());
25 const char kEnablePrefix[] = "Enable";
26 const char kFieldTrialName[] = "GoogleNow";
27 std::string enable_prefix(kEnablePrefix);
28 std::string field_trial_result =
29 base::FieldTrialList::FindFullName(kFieldTrialName);
30 if ((field_trial_result.compare(
32 enable_prefix.length(),
33 enable_prefix) == 0) ||
34 CommandLine::ForCurrentProcess()->HasSwitch(
35 switches::kEnableGoogleNowIntegration)) {
36 web_ui()->CallJavascriptFunction(
37 "GeolocationOptions.showGeolocationOption");
41 } // namespace options