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

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

Issue 2393773002: Fix devtools unable to start a shared workers. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « chrome/browser/search/iframe_source.cc ('k') | chrome/browser/ui/webui/ntp/new_tab_ui.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/app_launcher_page_ui.h" 5 #include "chrome/browser/ui/webui/app_launcher_page_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/ref_counted_memory.h" 9 #include "base/memory/ref_counted_memory.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 void AppLauncherPageUI::HTMLSource::StartDataRequest( 106 void AppLauncherPageUI::HTMLSource::StartDataRequest(
107 const std::string& path, 107 const std::string& path,
108 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, 108 const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
109 const content::URLDataSource::GotDataCallback& callback) { 109 const content::URLDataSource::GotDataCallback& callback) {
110 DCHECK_CURRENTLY_ON(BrowserThread::UI); 110 DCHECK_CURRENTLY_ON(BrowserThread::UI);
111 111
112 NTPResourceCache* resource = AppResourceCacheFactory::GetForProfile(profile_); 112 NTPResourceCache* resource = AppResourceCacheFactory::GetForProfile(profile_);
113 resource->set_should_show_other_devices_menu(false); 113 resource->set_should_show_other_devices_menu(false);
114 114
115 content::WebContents* web_contents = wc_getter.Run();
115 content::RenderProcessHost* render_host = 116 content::RenderProcessHost* render_host =
116 wc_getter.Run()->GetRenderProcessHost(); 117 web_contents ? web_contents->GetRenderProcessHost() : nullptr;
117 NTPResourceCache::WindowType win_type = NTPResourceCache::GetWindowType( 118 NTPResourceCache::WindowType win_type = NTPResourceCache::GetWindowType(
118 profile_, render_host); 119 profile_, render_host);
119 scoped_refptr<base::RefCountedMemory> html_bytes( 120 scoped_refptr<base::RefCountedMemory> html_bytes(
120 resource->GetNewTabHTML(win_type)); 121 resource->GetNewTabHTML(win_type));
121 122
122 callback.Run(html_bytes.get()); 123 callback.Run(html_bytes.get());
123 } 124 }
124 125
125 std::string AppLauncherPageUI::HTMLSource::GetMimeType( 126 std::string AppLauncherPageUI::HTMLSource::GetMimeType(
126 const std::string& resource) const { 127 const std::string& resource) const {
(...skipping 15 matching lines...) Expand all
142 return "style-src 'self' chrome://resources chrome://theme 'unsafe-inline';"; 143 return "style-src 'self' chrome://resources chrome://theme 'unsafe-inline';";
143 } 144 }
144 145
145 std::string AppLauncherPageUI::HTMLSource::GetContentSecurityPolicyImgSrc() 146 std::string AppLauncherPageUI::HTMLSource::GetContentSecurityPolicyImgSrc()
146 const { 147 const {
147 return "img-src chrome://extension-icon chrome://theme chrome://resources " 148 return "img-src chrome://extension-icon chrome://theme chrome://resources "
148 "data:;"; 149 "data:;";
149 } 150 }
150 151
151 AppLauncherPageUI::HTMLSource::~HTMLSource() {} 152 AppLauncherPageUI::HTMLSource::~HTMLSource() {}
OLDNEW
« no previous file with comments | « chrome/browser/search/iframe_source.cc ('k') | chrome/browser/ui/webui/ntp/new_tab_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698