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

Side by Side Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc

Issue 2839043004: chromeos: Refactor ash SystemTrayDelegate enterprise methods to mojo (Closed)
Patch Set: review comments Created 3 years, 7 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
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.cc ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/ntp/ntp_resource_cache.h" 5 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "ui/base/l10n/l10n_util.h" 56 #include "ui/base/l10n/l10n_util.h"
57 #include "ui/base/resource/resource_bundle.h" 57 #include "ui/base/resource/resource_bundle.h"
58 #include "ui/base/template_expressions.h" 58 #include "ui/base/template_expressions.h"
59 #include "ui/base/theme_provider.h" 59 #include "ui/base/theme_provider.h"
60 #include "ui/base/webui/jstemplate_builder.h" 60 #include "ui/base/webui/jstemplate_builder.h"
61 #include "ui/base/webui/web_ui_util.h" 61 #include "ui/base/webui/web_ui_util.h"
62 #include "ui/gfx/animation/animation.h" 62 #include "ui/gfx/animation/animation.h"
63 #include "ui/gfx/color_utils.h" 63 #include "ui/gfx/color_utils.h"
64 64
65 #if defined(OS_CHROMEOS) 65 #if defined(OS_CHROMEOS)
66 #include "ash/strings/grit/ash_strings.h"
66 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 67 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
67 #include "chromeos/chromeos_switches.h" 68 #include "chromeos/chromeos_switches.h"
68 #endif 69 #endif
69 70
70 #if defined(OS_MACOSX) 71 #if defined(OS_MACOSX)
71 #include "chrome/browser/platform_util.h" 72 #include "chrome/browser/platform_util.h"
72 #endif 73 #endif
73 74
74 using content::BrowserThread; 75 using content::BrowserThread;
75 76
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 int guest_tab_heading_ids = IDS_NEW_TAB_GUEST_SESSION_HEADING; 338 int guest_tab_heading_ids = IDS_NEW_TAB_GUEST_SESSION_HEADING;
338 int guest_tab_link_ids = IDS_NEW_TAB_GUEST_SESSION_LEARN_MORE_LINK; 339 int guest_tab_link_ids = IDS_NEW_TAB_GUEST_SESSION_LEARN_MORE_LINK;
339 340
340 #if defined(OS_CHROMEOS) 341 #if defined(OS_CHROMEOS)
341 guest_tab_ids = IDR_GUEST_SESSION_TAB_HTML; 342 guest_tab_ids = IDR_GUEST_SESSION_TAB_HTML;
342 343
343 policy::BrowserPolicyConnectorChromeOS* connector = 344 policy::BrowserPolicyConnectorChromeOS* connector =
344 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 345 g_browser_process->platform_part()->browser_policy_connector_chromeos();
345 std::string enterprise_domain = connector->GetEnterpriseDomain(); 346 std::string enterprise_domain = connector->GetEnterpriseDomain();
346 347
348 // TODO(jamescook): What about Active Directory managed devices?
347 if (!enterprise_domain.empty()) { 349 if (!enterprise_domain.empty()) {
348 // Device is enterprise enrolled. 350 // Device is enterprise enrolled.
349 localized_strings.SetString("enterpriseInfoVisible", "true"); 351 localized_strings.SetString("enterpriseInfoVisible", "true");
350 base::string16 enterprise_info = l10n_util::GetStringFUTF16( 352 base::string16 enterprise_info =
351 IDS_DEVICE_OWNED_BY_NOTICE, 353 l10n_util::GetStringFUTF16(IDS_ASH_ENTERPRISE_DEVICE_MANAGED_BY,
352 base::UTF8ToUTF16(enterprise_domain)); 354 base::UTF8ToUTF16(enterprise_domain));
353 localized_strings.SetString("enterpriseInfoMessage", enterprise_info); 355 localized_strings.SetString("enterpriseInfoMessage", enterprise_info);
354 localized_strings.SetString("enterpriseLearnMore", 356 localized_strings.SetString("enterpriseLearnMore",
355 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); 357 l10n_util::GetStringUTF16(IDS_LEARN_MORE));
356 localized_strings.SetString("enterpriseInfoHintLink", 358 localized_strings.SetString("enterpriseInfoHintLink",
357 chrome::kLearnMoreEnterpriseURL); 359 chrome::kLearnMoreEnterpriseURL);
358 } else { 360 } else {
359 localized_strings.SetString("enterpriseInfoVisible", "false"); 361 localized_strings.SetString("enterpriseInfoVisible", "false");
360 } 362 }
361 #endif 363 #endif
362 364
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 // Get our template. 601 // Get our template.
600 static const base::StringPiece new_tab_theme_css( 602 static const base::StringPiece new_tab_theme_css(
601 ResourceBundle::GetSharedInstance().GetRawDataResource( 603 ResourceBundle::GetSharedInstance().GetRawDataResource(
602 IDR_NEW_TAB_4_THEME_CSS)); 604 IDR_NEW_TAB_4_THEME_CSS));
603 605
604 // Create the string from our template and the replacements. 606 // Create the string from our template and the replacements.
605 std::string css_string = 607 std::string css_string =
606 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions); 608 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions);
607 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 609 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
608 } 610 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698