| 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() { | 35 std::string LocalOmniboxPopupSource::GetSource() { |
| 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 const content::URLDataSource::ExtraRequestInfo& info, |
| 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; |
| 46 } else if (path == kJSFilename) { | 46 } else if (path == kJSFilename) { |
| 47 identifier = IDR_LOCAL_OMNIBOX_POPUP_JS; | 47 identifier = IDR_LOCAL_OMNIBOX_POPUP_JS; |
| 48 } else if (path == kCssFilename) { | 48 } else if (path == kCssFilename) { |
| 49 identifier = IDR_LOCAL_OMNIBOX_POPUP_CSS; | 49 identifier = IDR_LOCAL_OMNIBOX_POPUP_CSS; |
| 50 } else if (path == kPageIconFilename) { | 50 } else if (path == kPageIconFilename) { |
| 51 identifier = IDR_LOCAL_OMNIBOX_POPUP_IMAGES_PAGE_ICON_PNG; | 51 identifier = IDR_LOCAL_OMNIBOX_POPUP_IMAGES_PAGE_ICON_PNG; |
| (...skipping 41 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 |