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

Side by Side Diff: chrome/browser/search/local_ntp_source.cc

Issue 13375003: Fixing iframe jank in the local omnibox popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: virtual Created 7 years, 8 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/search/local_ntp_source.h ('k') | chrome/browser/search/suggestion_source.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/search/local_ntp_source.h" 5 #include "chrome/browser/search/local_ntp_source.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h"
10 #include "chrome/common/url_constants.h" 11 #include "chrome/common/url_constants.h"
11 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
12 #include "grit/browser_resources.h" 13 #include "grit/browser_resources.h"
13 #include "grit/ui_resources.h" 14 #include "grit/ui_resources.h"
14 #include "net/url_request/url_request.h" 15 #include "net/url_request/url_request.h"
15 #include "ui/base/resource/resource_bundle.h" 16 #include "ui/base/resource/resource_bundle.h"
16 17
17 namespace { 18 namespace {
18 19
19 const struct Resource{ 20 const struct Resource{
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 if (request->url().SchemeIs(chrome::kChromeSearchScheme)) { 97 if (request->url().SchemeIs(chrome::kChromeSearchScheme)) {
97 DCHECK(StartsWithASCII(request->url().path(), "/", true)); 98 DCHECK(StartsWithASCII(request->url().path(), "/", true));
98 std::string filename = request->url().path().substr(1); 99 std::string filename = request->url().path().substr(1);
99 for (size_t i = 0; i < arraysize(kResources); ++i) { 100 for (size_t i = 0; i < arraysize(kResources); ++i) {
100 if (filename == kResources[i].filename) 101 if (filename == kResources[i].filename)
101 return true; 102 return true;
102 } 103 }
103 } 104 }
104 return false; 105 return false;
105 } 106 }
107
108 std::string LocalNtpSource::GetContentSecurityPolicyFrameSrc() const {
109 // Allow embedding of chrome search suggestion host.
110 return base::StringPrintf("frame-src %s://%s/;",
111 chrome::kChromeSearchScheme,
112 chrome::kChromeSearchSuggestionHost);
113 }
OLDNEW
« no previous file with comments | « chrome/browser/search/local_ntp_source.h ('k') | chrome/browser/search/suggestion_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698