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/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 "apps/app_launcher.h" | 10 #include "apps/app_launcher.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "grit/theme_resources.h" | 53 #include "grit/theme_resources.h" |
54 #include "ui/base/animation/animation.h" | 54 #include "ui/base/animation/animation.h" |
55 #include "ui/base/l10n/l10n_util.h" | 55 #include "ui/base/l10n/l10n_util.h" |
56 #include "ui/base/resource/resource_bundle.h" | 56 #include "ui/base/resource/resource_bundle.h" |
57 #include "ui/base/theme_provider.h" | 57 #include "ui/base/theme_provider.h" |
58 #include "ui/gfx/color_utils.h" | 58 #include "ui/gfx/color_utils.h" |
59 #include "ui/gfx/sys_color_change_listener.h" | 59 #include "ui/gfx/sys_color_change_listener.h" |
60 #include "ui/webui/jstemplate_builder.h" | 60 #include "ui/webui/jstemplate_builder.h" |
61 #include "ui/webui/web_ui_util.h" | 61 #include "ui/webui/web_ui_util.h" |
62 | 62 |
| 63 #if defined(OS_CHROMEOS) |
| 64 #include "chromeos/chromeos_switches.h" |
| 65 #endif |
| 66 |
63 #if defined(OS_MACOSX) | 67 #if defined(OS_MACOSX) |
64 #include "chrome/browser/platform_util.h" | 68 #include "chrome/browser/platform_util.h" |
65 #endif | 69 #endif |
66 | 70 |
67 using content::BrowserThread; | 71 using content::BrowserThread; |
68 | 72 |
69 namespace { | 73 namespace { |
70 | 74 |
71 // The URL for the the Learn More page shown on incognito new tab. | 75 // The URL for the the Learn More page shown on incognito new tab. |
72 const char kLearnMoreIncognitoUrl[] = | 76 const char kLearnMoreIncognitoUrl[] = |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 276 |
273 void NTPResourceCache::CreateNewTabIncognitoHTML() { | 277 void NTPResourceCache::CreateNewTabIncognitoHTML() { |
274 DictionaryValue localized_strings; | 278 DictionaryValue localized_strings; |
275 localized_strings.SetString("title", | 279 localized_strings.SetString("title", |
276 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); | 280 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); |
277 int new_tab_message_ids = IDS_NEW_TAB_OTR_MESSAGE; | 281 int new_tab_message_ids = IDS_NEW_TAB_OTR_MESSAGE; |
278 int new_tab_html_idr = IDR_INCOGNITO_TAB_HTML; | 282 int new_tab_html_idr = IDR_INCOGNITO_TAB_HTML; |
279 const char* new_tab_link = kLearnMoreIncognitoUrl; | 283 const char* new_tab_link = kLearnMoreIncognitoUrl; |
280 // TODO(altimofeev): consider implementation without 'if def' usage. | 284 // TODO(altimofeev): consider implementation without 'if def' usage. |
281 #if defined(OS_CHROMEOS) | 285 #if defined(OS_CHROMEOS) |
282 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { | 286 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 287 chromeos::switches::kGuestSession)) { |
283 new_tab_message_ids = IDS_NEW_TAB_GUEST_SESSION_MESSAGE; | 288 new_tab_message_ids = IDS_NEW_TAB_GUEST_SESSION_MESSAGE; |
284 new_tab_html_idr = IDR_GUEST_SESSION_TAB_HTML; | 289 new_tab_html_idr = IDR_GUEST_SESSION_TAB_HTML; |
285 new_tab_link = kLearnMoreGuestSessionUrl; | 290 new_tab_link = kLearnMoreGuestSessionUrl; |
286 | 291 |
287 std::string enterprise_domain = | 292 std::string enterprise_domain = |
288 g_browser_process->browser_policy_connector()->GetEnterpriseDomain(); | 293 g_browser_process->browser_policy_connector()->GetEnterpriseDomain(); |
289 if (!enterprise_domain.empty()) { | 294 if (!enterprise_domain.empty()) { |
290 // Device is enterprise enrolled. | 295 // Device is enterprise enrolled. |
291 localized_strings.SetString("enterpriseInfoVisible", "true"); | 296 localized_strings.SetString("enterpriseInfoVisible", "true"); |
292 string16 enterprise_info = l10n_util::GetStringFUTF16( | 297 string16 enterprise_info = l10n_util::GetStringFUTF16( |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 // Get our template. | 620 // Get our template. |
616 static const base::StringPiece new_tab_theme_css( | 621 static const base::StringPiece new_tab_theme_css( |
617 ResourceBundle::GetSharedInstance().GetRawDataResource( | 622 ResourceBundle::GetSharedInstance().GetRawDataResource( |
618 IDR_NEW_TAB_4_THEME_CSS)); | 623 IDR_NEW_TAB_4_THEME_CSS)); |
619 | 624 |
620 // Create the string from our template and the replacements. | 625 // Create the string from our template and the replacements. |
621 std::string css_string; | 626 std::string css_string; |
622 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 627 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
623 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 628 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
624 } | 629 } |
OLD | NEW |