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

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

Issue 9836039: Add reporting notification to the enterprise banner on the CrOS login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/login/core_oobe_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/utf_string_conversions.h"
9 #include "base/values.h" 10 #include "base/values.h"
10 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" 11 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
12 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 12 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
13 #include "chrome/common/chrome_version_info.h" 13 #include "chrome/common/chrome_version_info.h"
14 #include "content/public/browser/web_ui.h" 14 #include "content/public/browser/web_ui.h"
15 #include "grit/chromium_strings.h" 15 #include "grit/chromium_strings.h"
16 #include "grit/generated_resources.h" 16 #include "grit/generated_resources.h"
17 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
18 18
19 namespace { 19 namespace {
20 20
(...skipping 17 matching lines...) Expand all
38 } 38 }
39 39
40 void CoreOobeHandler::GetLocalizedStrings( 40 void CoreOobeHandler::GetLocalizedStrings(
41 base::DictionaryValue* localized_strings) { 41 base::DictionaryValue* localized_strings) {
42 localized_strings->SetString( 42 localized_strings->SetString(
43 "title", l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)); 43 "title", l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME));
44 localized_strings->SetString( 44 localized_strings->SetString(
45 "productName", l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)); 45 "productName", l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME));
46 localized_strings->SetString( 46 localized_strings->SetString(
47 "learnMore", l10n_util::GetStringUTF16(IDS_LEARN_MORE)); 47 "learnMore", l10n_util::GetStringUTF16(IDS_LEARN_MORE));
48 localized_strings->SetString(
49 "reportingHint",
50 l10n_util::GetStringUTF16(IDS_LOGIN_MANAGED_REPORTING_HINT));
48 } 51 }
49 52
50 void CoreOobeHandler::Initialize() { 53 void CoreOobeHandler::Initialize() {
51 UpdateOobeUIVisibility(); 54 UpdateOobeUIVisibility();
52 #if defined(OFFICIAL_BUILD) 55 #if defined(OFFICIAL_BUILD)
53 version_info_updater_.StartUpdate(true); 56 version_info_updater_.StartUpdate(true);
54 #else 57 #else
55 version_info_updater_.StartUpdate(false); 58 version_info_updater_.StartUpdate(false);
56 #endif 59 #endif
57 } 60 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 const std::string& os_version_label_text) { 99 const std::string& os_version_label_text) {
97 UpdateLabel("version", os_version_label_text); 100 UpdateLabel("version", os_version_label_text);
98 } 101 }
99 102
100 void CoreOobeHandler::OnBootTimesLabelTextUpdated( 103 void CoreOobeHandler::OnBootTimesLabelTextUpdated(
101 const std::string& boot_times_label_text) { 104 const std::string& boot_times_label_text) {
102 UpdateLabel("boot-times", boot_times_label_text); 105 UpdateLabel("boot-times", boot_times_label_text);
103 } 106 }
104 107
105 void CoreOobeHandler::OnEnterpriseInfoUpdated( 108 void CoreOobeHandler::OnEnterpriseInfoUpdated(
106 const std::string& message_text) { 109 const std::string& message_text,
110 bool reporting_hint) {
107 base::StringValue message_text_vaue(UTF8ToUTF16(message_text)); 111 base::StringValue message_text_vaue(UTF8ToUTF16(message_text));
112 base::FundamentalValue show_help_link(reporting_hint);
108 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setEnterpriseInfo", 113 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setEnterpriseInfo",
109 message_text_vaue); 114 message_text_vaue,
115 show_help_link);
110 } 116 }
111 117
112 void CoreOobeHandler::UpdateLabel(const std::string& id, 118 void CoreOobeHandler::UpdateLabel(const std::string& id,
113 const std::string& text) { 119 const std::string& text) {
114 base::StringValue id_value(UTF8ToUTF16(id)); 120 base::StringValue id_value(UTF8ToUTF16(id));
115 base::StringValue text_value(UTF8ToUTF16(text)); 121 base::StringValue text_value(UTF8ToUTF16(text));
116 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setLabelText", 122 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setLabelText",
117 id_value, 123 id_value,
118 text_value); 124 text_value);
119 } 125 }
120 126
121 } // namespace chromeos 127 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698