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

Side by Side Diff: chrome/browser/search/suggestion_source.h

Issue 13375003: Fixing iframe jank in the local omnibox popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing comment. 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SEARCH_SUGGESTION_SOURCE_H_
6 #define CHROME_BROWSER_SEARCH_SUGGESTION_SOURCE_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "content/public/browser/url_data_source.h"
11
12 // Serves HTML for displaying suggestions using iframes, e.g.
13 // chrome-search://suggestion/loader.html
14 class SuggestionSource : public content::URLDataSource {
15 public:
16 SuggestionSource();
17 virtual ~SuggestionSource();
18
19 protected:
20 virtual bool GetOrigin(
21 int process_id,
22 int render_view_id,
23 std::string* origin) const;
24
25 // Overridden from content::URLDataSource:
26 virtual std::string GetSource() OVERRIDE;
27 virtual void StartDataRequest(
28 const std::string& path_and_query,
29 bool is_incognito,
30 const content::URLDataSource::GotDataCallback& callback) OVERRIDE;
31 virtual std::string GetMimeType(
32 const std::string& path_and_query) const OVERRIDE;
33 virtual bool ShouldDenyXFrameOptions() const OVERRIDE;
34 virtual bool ShouldServiceRequest(
35 const net::URLRequest* request) const OVERRIDE;
36 virtual void WillServiceRequest(
37 const net::URLRequest* request,
38 std::string* path) const OVERRIDE;
39
40 private:
41 // Sends unmodified resource bytes.
42 void SendResource(
43 int resource_id,
44 const content::URLDataSource::GotDataCallback& callback);
45
46 // Sends Javascript with an expected postMessage origin interpolated.
47 void SendJSWithOrigin(
48 int resource_id,
49 const std::string& path_and_query,
50 const content::URLDataSource::GotDataCallback& callback);
51
52 DISALLOW_COPY_AND_ASSIGN(SuggestionSource);
53 };
54
55 #endif // CHROME_BROWSER_SEARCH_SUGGESTION_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698