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

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

Issue 899173002: Replace Webstore link with app info dialog link in chrome://apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix error 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/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/command_line.h" 10 #include "base/command_line.h"
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/first_run/first_run.h" 21 #include "chrome/browser/first_run/first_run.h"
22 #include "chrome/browser/profiles/profile.h" 22 #include "chrome/browser/profiles/profile.h"
23 #include "chrome/browser/search/search.h" 23 #include "chrome/browser/search/search.h"
24 #include "chrome/browser/signin/signin_manager_factory.h" 24 #include "chrome/browser/signin/signin_manager_factory.h"
25 #include "chrome/browser/sync/profile_sync_service.h" 25 #include "chrome/browser/sync/profile_sync_service.h"
26 #include "chrome/browser/sync/profile_sync_service_factory.h" 26 #include "chrome/browser/sync/profile_sync_service_factory.h"
27 #include "chrome/browser/themes/theme_properties.h" 27 #include "chrome/browser/themes/theme_properties.h"
28 #include "chrome/browser/themes/theme_service.h" 28 #include "chrome/browser/themes/theme_service.h"
29 #include "chrome/browser/themes/theme_service_factory.h" 29 #include "chrome/browser/themes/theme_service_factory.h"
30 #include "chrome/browser/ui/app_list/app_list_util.h" 30 #include "chrome/browser/ui/app_list/app_list_util.h"
31 #include "chrome/browser/ui/apps/app_info_dialog.h"
31 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" 32 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h"
32 #include "chrome/browser/ui/sync/sync_promo_ui.h" 33 #include "chrome/browser/ui/sync/sync_promo_ui.h"
33 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" 34 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h"
34 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 35 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
35 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" 36 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h"
36 #include "chrome/browser/web_resource/notification_promo.h" 37 #include "chrome/browser/web_resource/notification_promo.h"
37 #include "chrome/common/chrome_switches.h" 38 #include "chrome/common/chrome_switches.h"
38 #include "chrome/common/pref_names.h" 39 #include "chrome/common/pref_names.h"
39 #include "chrome/common/url_constants.h" 40 #include "chrome/common/url_constants.h"
40 #include "chrome/grit/chromium_strings.h" 41 #include "chrome/grit/chromium_strings.h"
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 load_time_data.SetString("undothumbnailremove", 433 load_time_data.SetString("undothumbnailremove",
433 l10n_util::GetStringUTF16(IDS_NEW_TAB_UNDO_THUMBNAIL_REMOVE)); 434 l10n_util::GetStringUTF16(IDS_NEW_TAB_UNDO_THUMBNAIL_REMOVE));
434 load_time_data.SetString("removethumbnailtooltip", 435 load_time_data.SetString("removethumbnailtooltip",
435 l10n_util::GetStringUTF16(IDS_NEW_TAB_REMOVE_THUMBNAIL_TOOLTIP)); 436 l10n_util::GetStringUTF16(IDS_NEW_TAB_REMOVE_THUMBNAIL_TOOLTIP));
436 load_time_data.SetString("appuninstall", 437 load_time_data.SetString("appuninstall",
437 l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNINSTALL)); 438 l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNINSTALL));
438 load_time_data.SetString("appoptions", 439 load_time_data.SetString("appoptions",
439 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_OPTIONS)); 440 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_OPTIONS));
440 load_time_data.SetString("appdetails", 441 load_time_data.SetString("appdetails",
441 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_DETAILS)); 442 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_DETAILS));
443 load_time_data.SetString("appinfodialog",
444 l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_SHOW_INFO));
442 load_time_data.SetString("appcreateshortcut", 445 load_time_data.SetString("appcreateshortcut",
443 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_CREATE_SHORTCUT)); 446 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_CREATE_SHORTCUT));
444 load_time_data.SetString("appDefaultPageName", 447 load_time_data.SetString("appDefaultPageName",
445 l10n_util::GetStringUTF16(IDS_APP_DEFAULT_PAGE_NAME)); 448 l10n_util::GetStringUTF16(IDS_APP_DEFAULT_PAGE_NAME));
446 load_time_data.SetString("applaunchtypepinned", 449 load_time_data.SetString("applaunchtypepinned",
447 l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_OPEN_PINNED)); 450 l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_OPEN_PINNED));
448 load_time_data.SetString("applaunchtyperegular", 451 load_time_data.SetString("applaunchtyperegular",
449 l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_OPEN_REGULAR)); 452 l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_OPEN_REGULAR));
450 load_time_data.SetString("applaunchtypewindow", 453 load_time_data.SetString("applaunchtypewindow",
451 l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_OPEN_WINDOW)); 454 l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_OPEN_WINDOW));
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 load_time_data.SetBoolean("isSwipeTrackingFromScrollEventsEnabled", 498 load_time_data.SetBoolean("isSwipeTrackingFromScrollEventsEnabled",
496 is_swipe_tracking_from_scroll_events_enabled_); 499 is_swipe_tracking_from_scroll_events_enabled_);
497 500
498 load_time_data.SetBoolean("showApps", should_show_apps_page_); 501 load_time_data.SetBoolean("showApps", should_show_apps_page_);
499 load_time_data.SetBoolean("showWebStoreIcon", 502 load_time_data.SetBoolean("showWebStoreIcon",
500 !prefs->GetBoolean(prefs::kHideWebStoreIcon)); 503 !prefs->GetBoolean(prefs::kHideWebStoreIcon));
501 504
502 bool bookmark_apps_enabled = extensions::util::IsNewBookmarkAppsEnabled(); 505 bool bookmark_apps_enabled = extensions::util::IsNewBookmarkAppsEnabled();
503 load_time_data.SetBoolean("enableNewBookmarkApps", bookmark_apps_enabled); 506 load_time_data.SetBoolean("enableNewBookmarkApps", bookmark_apps_enabled);
504 507
508 load_time_data.SetBoolean("canShowAppInfoDialog",
509 CanShowAppInfoDialog());
510
505 #if defined(OS_CHROMEOS) 511 #if defined(OS_CHROMEOS)
506 load_time_data.SetString("expandMenu", 512 load_time_data.SetString("expandMenu",
507 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); 513 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND));
508 #endif 514 #endif
509 515
510 NewTabPageHandler::GetLocalizedValues(profile_, &load_time_data); 516 NewTabPageHandler::GetLocalizedValues(profile_, &load_time_data);
511 NTPLoginHandler::GetLocalizedValues(profile_, &load_time_data); 517 NTPLoginHandler::GetLocalizedValues(profile_, &load_time_data);
512 518
513 webui::SetLoadTimeDataDefaults(app_locale, &load_time_data); 519 webui::SetLoadTimeDataDefaults(app_locale, &load_time_data);
514 520
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 // Get our template. 720 // Get our template.
715 static const base::StringPiece new_tab_theme_css( 721 static const base::StringPiece new_tab_theme_css(
716 ResourceBundle::GetSharedInstance().GetRawDataResource( 722 ResourceBundle::GetSharedInstance().GetRawDataResource(
717 IDR_NEW_TAB_4_THEME_CSS)); 723 IDR_NEW_TAB_4_THEME_CSS));
718 724
719 // Create the string from our template and the replacements. 725 // Create the string from our template and the replacements.
720 std::string css_string; 726 std::string css_string;
721 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); 727 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
722 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 728 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
723 } 729 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698