OLD | NEW |
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_omnibox_popup_source.h" | 5 #include "chrome/browser/search/local_omnibox_popup_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 "base/stringprintf.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 LocalOmniboxPopupSource::~LocalOmniboxPopupSource() { | 32 LocalOmniboxPopupSource::~LocalOmniboxPopupSource() { |
33 } | 33 } |
34 | 34 |
35 std::string LocalOmniboxPopupSource::GetSource() const { | 35 std::string LocalOmniboxPopupSource::GetSource() const { |
36 return chrome::kChromeSearchLocalOmniboxPopupHost; | 36 return chrome::kChromeSearchLocalOmniboxPopupHost; |
37 } | 37 } |
38 | 38 |
39 void LocalOmniboxPopupSource::StartDataRequest( | 39 void LocalOmniboxPopupSource::StartDataRequest( |
40 const std::string& path, | 40 const std::string& path, |
41 bool is_incognito, | 41 int render_process_id, |
| 42 int render_view_id, |
42 const content::URLDataSource::GotDataCallback& callback) { | 43 const content::URLDataSource::GotDataCallback& callback) { |
43 int identifier = -1; | 44 int identifier = -1; |
44 if (path == kHtmlFilename) { | 45 if (path == kHtmlFilename) { |
45 identifier = IDR_LOCAL_OMNIBOX_POPUP_HTML; | 46 identifier = IDR_LOCAL_OMNIBOX_POPUP_HTML; |
46 } else if (path == kJSFilename) { | 47 } else if (path == kJSFilename) { |
47 identifier = IDR_LOCAL_OMNIBOX_POPUP_JS; | 48 identifier = IDR_LOCAL_OMNIBOX_POPUP_JS; |
48 } else if (path == kCssFilename) { | 49 } else if (path == kCssFilename) { |
49 identifier = IDR_LOCAL_OMNIBOX_POPUP_CSS; | 50 identifier = IDR_LOCAL_OMNIBOX_POPUP_CSS; |
50 } else if (path == kPageIconFilename) { | 51 } else if (path == kPageIconFilename) { |
51 identifier = IDR_LOCAL_OMNIBOX_POPUP_IMAGES_PAGE_ICON_PNG; | 52 identifier = IDR_LOCAL_OMNIBOX_POPUP_IMAGES_PAGE_ICON_PNG; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 94 } |
94 return false; | 95 return false; |
95 } | 96 } |
96 | 97 |
97 std::string LocalOmniboxPopupSource::GetContentSecurityPolicyFrameSrc() const { | 98 std::string LocalOmniboxPopupSource::GetContentSecurityPolicyFrameSrc() const { |
98 // Allow embedding of chrome search suggestion host. | 99 // Allow embedding of chrome search suggestion host. |
99 return base::StringPrintf("frame-src %s://%s/;", | 100 return base::StringPrintf("frame-src %s://%s/;", |
100 chrome::kChromeSearchScheme, | 101 chrome::kChromeSearchScheme, |
101 chrome::kChromeSearchSuggestionHost); | 102 chrome::kChromeSearchSuggestionHost); |
102 } | 103 } |
OLD | NEW |