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

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

Issue 9959030: Allow hiding of sessions from Other Devices via context menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase. Created 8 years, 8 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/ntp/foreign_session_handler.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 (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 <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/memory/ref_counted_memory.h" 11 #include "base/memory/ref_counted_memory.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/stringprintf.h" 14 #include "base/stringprintf.h"
15 #include "base/time.h"
16 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
17 #include "base/values.h" 16 #include "base/values.h"
18 #include "chrome/browser/defaults.h" 17 #include "chrome/browser/defaults.h"
19 #include "chrome/browser/google/google_util.h" 18 #include "chrome/browser/google/google_util.h"
20 #include "chrome/browser/prefs/pref_service.h" 19 #include "chrome/browser/prefs/pref_service.h"
21 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/sync/profile_sync_service.h" 21 #include "chrome/browser/sync/profile_sync_service.h"
23 #include "chrome/browser/sync/profile_sync_service_factory.h" 22 #include "chrome/browser/sync/profile_sync_service_factory.h"
24 #include "chrome/browser/themes/theme_service.h" 23 #include "chrome/browser/themes/theme_service.h"
25 #include "chrome/browser/themes/theme_service_factory.h" 24 #include "chrome/browser/themes/theme_service_factory.h"
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL()))); 355 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL())));
357 localized_strings.SetBoolean("isWebStoreExperimentEnabled", 356 localized_strings.SetBoolean("isWebStoreExperimentEnabled",
358 NewTabUI::ShouldShowWebStoreFooterLink()); 357 NewTabUI::ShouldShowWebStoreFooterLink());
359 localized_strings.SetBoolean("appInstallHintEnabled", 358 localized_strings.SetBoolean("appInstallHintEnabled",
360 NewTabUI::ShouldShowAppInstallHint()); 359 NewTabUI::ShouldShowAppInstallHint());
361 localized_strings.SetString("appInstallHintText", 360 localized_strings.SetString("appInstallHintText",
362 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL)); 361 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL));
363 localized_strings.SetBoolean("isSuggestionsPageEnabled", 362 localized_strings.SetBoolean("isSuggestionsPageEnabled",
364 NewTabUI::IsSuggestionsPageEnabled()); 363 NewTabUI::IsSuggestionsPageEnabled());
365 localized_strings.SetBoolean("showApps", NewTabUI::ShouldShowApps()); 364 localized_strings.SetBoolean("showApps", NewTabUI::ShouldShowApps());
365 localized_strings.SetString("hideSessionMenuItemText",
366 l10n_util::GetStringUTF16(IDS_POLICY_HIDE));
366 367
367 #if defined(OS_CHROMEOS) 368 #if defined(OS_CHROMEOS)
368 localized_strings.SetString("expandMenu", 369 localized_strings.SetString("expandMenu",
369 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); 370 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND));
370 #endif 371 #endif
371 372
372 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings); 373 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings);
373 NTPLoginHandler::GetLocalizedValues(profile_, &localized_strings); 374 NTPLoginHandler::GetLocalizedValues(profile_, &localized_strings);
374 375
375 // Don't initiate the sync related message passing with the page if the sync 376 // Don't initiate the sync related message passing with the page if the sync
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 // Get our template. 548 // Get our template.
548 static const base::StringPiece new_tab_theme_css( 549 static const base::StringPiece new_tab_theme_css(
549 ResourceBundle::GetSharedInstance().GetRawDataResource( 550 ResourceBundle::GetSharedInstance().GetRawDataResource(
550 IDR_NEW_TAB_4_THEME_CSS)); 551 IDR_NEW_TAB_4_THEME_CSS));
551 552
552 // Create the string from our template and the replacements. 553 // Create the string from our template and the replacements.
553 std::string css_string; 554 std::string css_string;
554 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); 555 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
555 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 556 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
556 } 557 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/foreign_session_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698