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 14 matching lines...) Expand all Loading... |
25 const char kSearchIcon2xFilename[] = "images/2x/search_icon.png"; | 25 const char kSearchIcon2xFilename[] = "images/2x/search_icon.png"; |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 LocalOmniboxPopupSource::LocalOmniboxPopupSource() { | 29 LocalOmniboxPopupSource::LocalOmniboxPopupSource() { |
30 } | 30 } |
31 | 31 |
32 LocalOmniboxPopupSource::~LocalOmniboxPopupSource() { | 32 LocalOmniboxPopupSource::~LocalOmniboxPopupSource() { |
33 } | 33 } |
34 | 34 |
35 std::string LocalOmniboxPopupSource::GetSource() { | 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 bool is_incognito, |
42 const content::URLDataSource::GotDataCallback& callback) { | 42 const content::URLDataSource::GotDataCallback& callback) { |
43 int identifier = -1; | 43 int identifier = -1; |
44 if (path == kHtmlFilename) { | 44 if (path == kHtmlFilename) { |
45 identifier = IDR_LOCAL_OMNIBOX_POPUP_HTML; | 45 identifier = IDR_LOCAL_OMNIBOX_POPUP_HTML; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 return false; | 94 return false; |
95 } | 95 } |
96 | 96 |
97 std::string LocalOmniboxPopupSource::GetContentSecurityPolicyFrameSrc() const { | 97 std::string LocalOmniboxPopupSource::GetContentSecurityPolicyFrameSrc() const { |
98 // Allow embedding of chrome search suggestion host. | 98 // Allow embedding of chrome search suggestion host. |
99 return base::StringPrintf("frame-src %s://%s/;", | 99 return base::StringPrintf("frame-src %s://%s/;", |
100 chrome::kChromeSearchScheme, | 100 chrome::kChromeSearchScheme, |
101 chrome::kChromeSearchSuggestionHost); | 101 chrome::kChromeSearchSuggestionHost); |
102 } | 102 } |
OLD | NEW |