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

Side by Side Diff: chrome/browser/dom_ui/labs_ui.cc

Issue 3776005: Merge 62624 - Rename about:labs to about:flags, step 1/3... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/552/src/
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/dom_ui_factory.cc ('k') | chrome/browser/labs.cc » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/dom_ui/labs_ui.h" 5 #include "chrome/browser/dom_ui/labs_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 18 matching lines...) Expand all
29 29
30 /////////////////////////////////////////////////////////////////////////////// 30 ///////////////////////////////////////////////////////////////////////////////
31 // 31 //
32 // LabsUIHTMLSource 32 // LabsUIHTMLSource
33 // 33 //
34 /////////////////////////////////////////////////////////////////////////////// 34 ///////////////////////////////////////////////////////////////////////////////
35 35
36 class LabsUIHTMLSource : public ChromeURLDataManager::DataSource { 36 class LabsUIHTMLSource : public ChromeURLDataManager::DataSource {
37 public: 37 public:
38 LabsUIHTMLSource() 38 LabsUIHTMLSource()
39 : DataSource(chrome::kChromeUILabsHost, MessageLoop::current()) {} 39 : DataSource(chrome::kChromeUIFlagsHost, MessageLoop::current()) {}
40 40
41 // Called when the network layer has requested a resource underneath 41 // Called when the network layer has requested a resource underneath
42 // the path we registered. 42 // the path we registered.
43 virtual void StartDataRequest(const std::string& path, 43 virtual void StartDataRequest(const std::string& path,
44 bool is_off_the_record, 44 bool is_off_the_record,
45 int request_id); 45 int request_id);
46 virtual std::string GetMimeType(const std::string&) const { 46 virtual std::string GetMimeType(const std::string&) const {
47 return "text/html"; 47 return "text/html";
48 } 48 }
49 49
50 private: 50 private:
51 ~LabsUIHTMLSource() {} 51 ~LabsUIHTMLSource() {}
52 52
53 DISALLOW_COPY_AND_ASSIGN(LabsUIHTMLSource); 53 DISALLOW_COPY_AND_ASSIGN(LabsUIHTMLSource);
54 }; 54 };
55 55
56 void LabsUIHTMLSource::StartDataRequest(const std::string& path, 56 void LabsUIHTMLSource::StartDataRequest(const std::string& path,
57 bool is_off_the_record, 57 bool is_off_the_record,
58 int request_id) { 58 int request_id) {
59 // Strings used in the JsTemplate file. 59 // Strings used in the JsTemplate file.
60 DictionaryValue localized_strings; 60 DictionaryValue localized_strings;
61 localized_strings.SetString("labsTitle",
62 l10n_util::GetStringUTF16(IDS_LABS_TITLE));
63 localized_strings.SetString("labsLongTitle", 61 localized_strings.SetString("labsLongTitle",
64 l10n_util::GetStringUTF16(IDS_LABS_LONG_TITLE)); 62 l10n_util::GetStringUTF16(IDS_FLAGS_LONG_TITLE));
65 localized_strings.SetString("labsTableTitle", 63 localized_strings.SetString("labsTableTitle",
66 l10n_util::GetStringUTF16(IDS_LABS_TABLE_TITLE)); 64 l10n_util::GetStringUTF16(IDS_FLAGS_TABLE_TITLE));
67 localized_strings.SetString("labsNoExperimentsAvailable", 65 localized_strings.SetString("labsNoExperimentsAvailable",
68 l10n_util::GetStringUTF16(IDS_LABS_NO_EXPERIMENTS_AVAILABLE)); 66 l10n_util::GetStringUTF16(IDS_FLAGS_NO_EXPERIMENTS_AVAILABLE));
67 localized_strings.SetString("flagsWarningHeader", l10n_util::GetStringUTF16(
68 IDS_FLAGS_WARNING_HEADER));
69 localized_strings.SetString("labsBlurb", l10n_util::GetStringFUTF16( 69 localized_strings.SetString("labsBlurb", l10n_util::GetStringFUTF16(
70 IDS_LABS_BLURB, 70 IDS_FLAGS_WARNING_TEXT,
71 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); 71 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
72 localized_strings.SetString("labsRestartNotice", l10n_util::GetStringFUTF16( 72 localized_strings.SetString("labsRestartNotice", l10n_util::GetStringFUTF16(
73 IDS_LABS_RESTART_NOTICE, 73 IDS_FLAGS_RESTART_NOTICE,
74 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); 74 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
75 localized_strings.SetString("labsRestartButton", 75 localized_strings.SetString("labsRestartButton",
76 l10n_util::GetStringUTF16(IDS_LABS_RESTART_BUTTON)); 76 l10n_util::GetStringUTF16(IDS_FLAGS_RESTART_BUTTON));
77 localized_strings.SetString("disable", 77 localized_strings.SetString("disable",
78 l10n_util::GetStringUTF16(IDS_LABS_DISABLE)); 78 l10n_util::GetStringUTF16(IDS_FLAGS_DISABLE));
79 localized_strings.SetString("enable", 79 localized_strings.SetString("enable",
80 l10n_util::GetStringUTF16(IDS_LABS_ENABLE)); 80 l10n_util::GetStringUTF16(IDS_FLAGS_ENABLE));
81 81
82 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); 82 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings);
83 83
84 static const base::StringPiece labs_html( 84 static const base::StringPiece labs_html(
85 ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_LABS_HTML)); 85 ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_LABS_HTML));
86 std::string full_html(labs_html.data(), labs_html.size()); 86 std::string full_html(labs_html.data(), labs_html.size());
87 jstemplate_builder::AppendJsonHtml(&localized_strings, &full_html); 87 jstemplate_builder::AppendJsonHtml(&localized_strings, &full_html);
88 jstemplate_builder::AppendI18nTemplateSourceHtml(&full_html); 88 jstemplate_builder::AppendI18nTemplateSourceHtml(&full_html);
89 jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html); 89 jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html);
90 jstemplate_builder::AppendJsTemplateSourceHtml(&full_html); 90 jstemplate_builder::AppendJsTemplateSourceHtml(&full_html);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // static 191 // static
192 RefCountedMemory* LabsUI::GetFaviconResourceBytes() { 192 RefCountedMemory* LabsUI::GetFaviconResourceBytes() {
193 return ResourceBundle::GetSharedInstance(). 193 return ResourceBundle::GetSharedInstance().
194 LoadDataResourceBytes(IDR_LABS); 194 LoadDataResourceBytes(IDR_LABS);
195 } 195 }
196 196
197 // static 197 // static
198 void LabsUI::RegisterUserPrefs(PrefService* prefs) { 198 void LabsUI::RegisterUserPrefs(PrefService* prefs) {
199 prefs->RegisterListPref(prefs::kEnabledLabsExperiments); 199 prefs->RegisterListPref(prefs::kEnabledLabsExperiments);
200 } 200 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/dom_ui_factory.cc ('k') | chrome/browser/labs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698