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

Side by Side Diff: chrome/browser/ui/webui/options/automatic_settings_reset_handler.cc

Issue 411273006: Incorporate reset button in post-automatic-reset settings-banner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style nit++ Created 6 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/options/automatic_settings_reset_handler.h" 5 #include "chrome/browser/ui/webui/options/automatic_settings_reset_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/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/prefs/chrome_pref_service_factory.h" 10 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
(...skipping 26 matching lines...) Expand all
37 if ((now - then).InDays() < kBannerShowTimeInDays) 37 if ((now - then).InDays() < kBannerShowTimeInDays)
38 web_ui()->CallJavascriptFunction("AutomaticSettingsResetBanner.show"); 38 web_ui()->CallJavascriptFunction("AutomaticSettingsResetBanner.show");
39 } 39 }
40 } 40 }
41 41
42 void AutomaticSettingsResetHandler::GetLocalizedValues( 42 void AutomaticSettingsResetHandler::GetLocalizedValues(
43 base::DictionaryValue* localized_strings) { 43 base::DictionaryValue* localized_strings) {
44 DCHECK(localized_strings); 44 DCHECK(localized_strings);
45 45
46 static const OptionsStringResource resources[] = { 46 static const OptionsStringResource resources[] = {
47 { "automaticSettingsResetBannerResetButtonText",
48 IDS_AUTOMATIC_SETTINGS_RESET_BANNER_RESET_BUTTON_TEXT },
47 { "automaticSettingsResetBannerText", 49 { "automaticSettingsResetBannerText",
48 IDS_AUTOMATIC_SETTINGS_RESET_BANNER_TEXT }, 50 IDS_AUTOMATIC_SETTINGS_RESET_BANNER_TEXT },
49 { "automaticSettingsResetLearnMoreUrl", 51 { "automaticSettingsResetLearnMoreUrl",
50 IDS_LEARN_MORE }, 52 IDS_LEARN_MORE },
51 }; 53 };
52 54
53 RegisterStrings(localized_strings, resources, arraysize(resources)); 55 RegisterStrings(localized_strings, resources, arraysize(resources));
54 localized_strings->SetString( 56 localized_strings->SetString(
55 "automaticSettingsResetLearnMoreUrl", 57 "automaticSettingsResetLearnMoreUrl",
56 chrome::kAutomaticSettingsResetLearnMoreURL); 58 chrome::kAutomaticSettingsResetLearnMoreURL);
57 } 59 }
58 60
59 void AutomaticSettingsResetHandler::RegisterMessages() { 61 void AutomaticSettingsResetHandler::RegisterMessages() {
60 web_ui()->RegisterMessageCallback( 62 web_ui()->RegisterMessageCallback(
61 "onDismissedAutomaticSettingsResetBanner", 63 "onDismissedAutomaticSettingsResetBanner",
62 base::Bind(&OnDismissedAutomaticSettingsResetBanner, 64 base::Bind(&OnDismissedAutomaticSettingsResetBanner,
63 Profile::FromWebUI(web_ui()))); 65 Profile::FromWebUI(web_ui())));
64 } 66 }
65 67
66 } // namespace options 68 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/reset_profile_settings_overlay.js ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698