| 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 #ifndef CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_ |
| 6 #define CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_ | 6 #define CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "content/public/browser/url_data_source.h" | 10 #include "content/public/browser/url_data_source.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // Sends unmodified resource bytes. | 29 // Sends unmodified resource bytes. |
| 30 void SendResource( | 30 void SendResource( |
| 31 int resource_id, | 31 int resource_id, |
| 32 const content::URLDataSource::GotDataCallback& callback); | 32 const content::URLDataSource::GotDataCallback& callback); |
| 33 | 33 |
| 34 // Sends Javascript with an expected postMessage origin interpolated. | 34 // Sends Javascript with an expected postMessage origin interpolated. |
| 35 void SendJSWithOrigin( | 35 void SendJSWithOrigin( |
| 36 int resource_id, | 36 int resource_id, |
| 37 int render_process_id, | 37 int render_process_id, |
| 38 int render_view_id, | 38 int render_frame_id, |
| 39 const content::URLDataSource::GotDataCallback& callback); | 39 const content::URLDataSource::GotDataCallback& callback); |
| 40 | 40 |
| 41 // This is exposed for testing and should not be overridden. | 41 // This is exposed for testing and should not be overridden. |
| 42 // Sets |origin| to the URL of the render view identified by |process_id| and | 42 // Sets |origin| to the URL of the render frame identified by |process_id| and |
| 43 // |render_view_id|. Returns true if successful and false if not, for example | 43 // |render_frame_id|. Returns true if successful and false if not, for example |
| 44 // if the render view does not exist. | 44 // if the render frame does not exist. |
| 45 virtual bool GetOrigin( | 45 virtual bool GetOrigin( |
| 46 int process_id, | 46 int process_id, |
| 47 int render_view_id, | 47 int render_frame_id, |
| 48 std::string* origin) const; | 48 std::string* origin) const; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(IframeSource); | 50 DISALLOW_COPY_AND_ASSIGN(IframeSource); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 #endif // CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_ | 53 #endif // CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_ |
| OLD | NEW |