Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc

Issue 880313002: webui: add [lang] attribute to <html> element on all webui pages so (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cros Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/chromeos/mobile_setup_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/json/json_writer.h" 13 #include "base/json/json_writer.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/memory/ref_counted_memory.h" 15 #include "base/memory/ref_counted_memory.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "base/message_loop/message_loop.h" 17 #include "base/message_loop/message_loop.h"
18 #include "base/metrics/histogram.h" 18 #include "base/metrics/histogram.h"
19 #include "base/strings/string_piece.h" 19 #include "base/strings/string_piece.h"
20 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
21 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
22 #include "base/values.h" 22 #include "base/values.h"
23 #include "chrome/browser/browser_process.h"
23 #include "chrome/browser/chromeos/mobile/mobile_activator.h" 24 #include "chrome/browser/chromeos/mobile/mobile_activator.h"
24 #include "chrome/browser/profiles/profile.h" 25 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/browser/ui/browser_list.h" 26 #include "chrome/browser/ui/browser_list.h"
26 #include "chrome/common/render_messages.h" 27 #include "chrome/common/render_messages.h"
27 #include "chrome/common/url_constants.h" 28 #include "chrome/common/url_constants.h"
28 #include "chrome/grit/generated_resources.h" 29 #include "chrome/grit/generated_resources.h"
29 #include "chrome/grit/locale_settings.h" 30 #include "chrome/grit/locale_settings.h"
30 #include "chromeos/network/device_state.h" 31 #include "chromeos/network/device_state.h"
31 #include "chromeos/network/network_configuration_handler.h" 32 #include "chromeos/network/network_configuration_handler.h"
32 #include "chromeos/network/network_event_log.h" 33 #include "chromeos/network/network_event_log.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 l10n_util::GetStringUTF16(IDS_MOBILE_NO_CONNECTION_HEADER)); 324 l10n_util::GetStringUTF16(IDS_MOBILE_NO_CONNECTION_HEADER));
324 strings.SetString("invalid_device_info_header", 325 strings.SetString("invalid_device_info_header",
325 l10n_util::GetStringUTF16(IDS_MOBILE_INVALID_DEVICE_INFO_HEADER)); 326 l10n_util::GetStringUTF16(IDS_MOBILE_INVALID_DEVICE_INFO_HEADER));
326 strings.SetString("title", l10n_util::GetStringUTF16(IDS_MOBILE_SETUP_TITLE)); 327 strings.SetString("title", l10n_util::GetStringUTF16(IDS_MOBILE_SETUP_TITLE));
327 strings.SetString("close_button", 328 strings.SetString("close_button",
328 l10n_util::GetStringUTF16(IDS_CLOSE)); 329 l10n_util::GetStringUTF16(IDS_CLOSE));
329 strings.SetString("cancel_button", 330 strings.SetString("cancel_button",
330 l10n_util::GetStringUTF16(IDS_CANCEL)); 331 l10n_util::GetStringUTF16(IDS_CANCEL));
331 strings.SetString("ok_button", 332 strings.SetString("ok_button",
332 l10n_util::GetStringUTF16(IDS_OK)); 333 l10n_util::GetStringUTF16(IDS_OK));
333 webui::SetFontAndTextDirection(&strings); 334
335 const std::string& app_locale = g_browser_process->GetApplicationLocale();
336 webui::SetLoadTimeDataDefaults(app_locale, &strings);
334 337
335 // The webui differs based on whether the network is activated or not. If the 338 // The webui differs based on whether the network is activated or not. If the
336 // network is activated, the webui goes straight to portal. Otherwise the 339 // network is activated, the webui goes straight to portal. Otherwise the
337 // webui is used for activation flow. 340 // webui is used for activation flow.
338 std::string full_html; 341 std::string full_html;
339 if (activation_state == shill::kActivationStateActivated) { 342 if (activation_state == shill::kActivationStateActivated) {
340 static const base::StringPiece html_for_activated( 343 static const base::StringPiece html_for_activated(
341 ResourceBundle::GetSharedInstance().GetRawDataResource( 344 ResourceBundle::GetSharedInstance().GetRawDataResource(
342 IDR_MOBILE_SETUP_PORTAL_PAGE_HTML)); 345 IDR_MOBILE_SETUP_PORTAL_PAGE_HTML));
343 full_html = webui::GetI18nTemplateHtml(html_for_activated, &strings); 346 full_html = webui::GetI18nTemplateHtml(html_for_activated, &strings);
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 const GURL& validated_url, 647 const GURL& validated_url,
645 int error_code, 648 int error_code,
646 const base::string16& error_description) { 649 const base::string16& error_description) {
647 if (render_frame_host->GetFrameName() != "paymentForm") 650 if (render_frame_host->GetFrameName() != "paymentForm")
648 return; 651 return;
649 652
650 base::FundamentalValue result_value(-error_code); 653 base::FundamentalValue result_value(-error_code);
651 web_ui()->CallJavascriptFunction(kJsPortalFrameLoadFailedCallback, 654 web_ui()->CallJavascriptFunction(kJsPortalFrameLoadFailedCallback,
652 result_value); 655 result_value);
653 } 656 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/oobe_ui.cc ('k') | chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698