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

Side by Side Diff: chrome/browser/ui/webui/set_as_default_browser_ui.cc

Issue 586953002: get rid of almost all old fashioned i18nTemplates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: window dot Created 6 years, 2 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/set_as_default_browser_ui.h" 5 #include "chrome/browser/ui/webui/set_as_default_browser_ui.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/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 MAKE_CHROME_DEFAULT_ACCEPTED = 0, 57 MAKE_CHROME_DEFAULT_ACCEPTED = 0,
58 MAKE_CHROME_DEFAULT_DECLINED = 1, 58 MAKE_CHROME_DEFAULT_DECLINED = 1,
59 MAKE_CHROME_DEFAULT_REGRETTED = 2, 59 MAKE_CHROME_DEFAULT_REGRETTED = 2,
60 // MAKE_CHROME_DEFAULT_ACCEPTED_IMMERSE = 3, // Deprecated. 60 // MAKE_CHROME_DEFAULT_ACCEPTED_IMMERSE = 3, // Deprecated.
61 MAKE_CHROME_DEFAULT_MAX 61 MAKE_CHROME_DEFAULT_MAX
62 }; 62 };
63 63
64 content::WebUIDataSource* CreateSetAsDefaultBrowserUIHTMLSource() { 64 content::WebUIDataSource* CreateSetAsDefaultBrowserUIHTMLSource() {
65 content::WebUIDataSource* data_source = content::WebUIDataSource::Create( 65 content::WebUIDataSource* data_source = content::WebUIDataSource::Create(
66 chrome::kChromeUIMetroFlowHost); 66 chrome::kChromeUIMetroFlowHost);
67 data_source->SetUseJsonJSFormatV2();
67 data_source->AddLocalizedString("page-title", IDS_METRO_FLOW_TAB_TITLE); 68 data_source->AddLocalizedString("page-title", IDS_METRO_FLOW_TAB_TITLE);
68 data_source->AddLocalizedString("flowTitle", IDS_METRO_FLOW_TITLE_SHORT); 69 data_source->AddLocalizedString("flowTitle", IDS_METRO_FLOW_TITLE_SHORT);
69 data_source->AddLocalizedString("flowDescription", 70 data_source->AddLocalizedString("flowDescription",
70 IDS_METRO_FLOW_DESCRIPTION); 71 IDS_METRO_FLOW_DESCRIPTION);
71 data_source->AddLocalizedString("flowNext", 72 data_source->AddLocalizedString("flowNext",
72 IDS_METRO_FLOW_SET_DEFAULT); 73 IDS_METRO_FLOW_SET_DEFAULT);
73 data_source->AddLocalizedString("chromeLogoString", 74 data_source->AddLocalizedString("chromeLogoString",
74 IDS_METRO_FLOW_LOGO_STRING_ALT); 75 IDS_METRO_FLOW_LOGO_STRING_ALT);
75 data_source->SetJsonPath("strings.js"); 76 data_source->SetJsonPath("strings.js");
76 data_source->AddResourcePath("set_as_default_browser.js", 77 data_source->AddResourcePath("set_as_default_browser.js",
77 IDR_SET_AS_DEFAULT_BROWSER_JS); 78 IDR_SET_AS_DEFAULT_BROWSER_JS);
78 data_source->SetDefaultResource(IDR_SET_AS_DEFAULT_BROWSER_HTML); 79 data_source->SetDefaultResource(IDR_SET_AS_DEFAULT_BROWSER_HTML);
79 return data_source; 80 return data_source;
80 } 81 }
81 82
82 // A simple class serving as a delegate for passing down the result of the 83 // A simple class serving as a delegate for passing down the result of the
83 // interaction. 84 // interaction.
84 class ResponseDelegate { 85 class ResponseDelegate {
85 public: 86 public:
86 virtual void SetDialogInteractionResult(MakeChromeDefaultResult result) = 0; 87 virtual void SetDialogInteractionResult(MakeChromeDefaultResult result) = 0;
87 88
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 Profile::FromWebUI(web_ui), CreateSetAsDefaultBrowserUIHTMLSource()); 365 Profile::FromWebUI(web_ui), CreateSetAsDefaultBrowserUIHTMLSource());
365 } 366 }
366 367
367 // static 368 // static
368 void SetAsDefaultBrowserUI::Show(Profile* profile, Browser* browser) { 369 void SetAsDefaultBrowserUI::Show(Profile* profile, Browser* browser) {
369 DCHECK_CURRENTLY_ON(BrowserThread::UI); 370 DCHECK_CURRENTLY_ON(BrowserThread::UI);
370 SetAsDefaultBrowserDialogImpl* dialog = 371 SetAsDefaultBrowserDialogImpl* dialog =
371 new SetAsDefaultBrowserDialogImpl(profile, browser); 372 new SetAsDefaultBrowserDialogImpl(profile, browser);
372 dialog->ShowDialog(); 373 dialog->ShowDialog();
373 } 374 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/quota_internals/quota_internals_ui.cc ('k') | chrome/browser/ui/webui/signin_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698