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

Side by Side Diff: chrome/browser/ui/webui/help/help_ui.cc

Issue 2931243002: Unframe chrome://extensions as it's the last (and only) uber item (Closed)
Patch Set: policy_android.css Created 3 years, 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/help/help_ui.h"
6
7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/webui/help/help_handler.h"
10 #include "chrome/common/url_constants.h"
11 #include "chrome/grit/browser_resources.h"
12 #include "content/public/browser/web_contents.h"
13 #include "content/public/browser/web_ui.h"
14 #include "content/public/browser/web_ui_data_source.h"
15
16 namespace {
17
18 content::WebUIDataSource* CreateAboutPageHTMLSource() {
19 content::WebUIDataSource* source =
20 content::WebUIDataSource::Create(chrome::kChromeUIHelpFrameHost);
21 source->SetJsonPath("strings.js");
22 source->AddResourcePath("help.js", IDR_HELP_JS);
23 source->AddResourcePath("help_page.js", IDR_HELP_PAGE_JS);
24 source->AddResourcePath("channel_change_page.js", IDR_CHANNEL_CHANGE_PAGE_JS);
25 source->SetDefaultResource(IDR_HELP_HTML);
26 source->DisableDenyXFrameOptions();
27 return source;
28 }
29
30 } // namespace
31
32 HelpUI::HelpUI(content::WebUI* web_ui)
33 : WebUIController(web_ui) {
34 Profile* profile = Profile::FromWebUI(web_ui);
35 content::WebUIDataSource* source = CreateAboutPageHTMLSource();
36
37 base::DictionaryValue localized_strings;
38 HelpHandler::GetLocalizedValues(&localized_strings);
39 source->AddLocalizedStrings(localized_strings);
40 content::WebUIDataSource::Add(profile, source);
41 web_ui->AddMessageHandler(base::MakeUnique<HelpHandler>());
42 }
43
44 HelpUI::~HelpUI() {
45 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/help/help_ui.h ('k') | chrome/browser/ui/webui/log_web_ui_url_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698