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

Side by Side Diff: extensions/browser/guest_view/web_view/web_ui/web_ui_url_fetcher.h

Issue 1056533002: Implement <webview>.addContentScript/removeContentScript API [2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webview_addremove_contentscripts_2
Patch Set: Refactoring in UserScriptLoader and etc. Created 5 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
OLDNEW
(Empty)
1 // Copyright 2015 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 EXTENSIONS_BROWSER_WEB_UI_URL_FETCHER_H
Fady Samuel 2015/04/20 13:01:04 Update this?
Xi Han 2015/04/20 22:40:10 Done.
6 #define EXTENSIONS_BROWSER_WEB_UI_URL_FETCHER_H
7
8 #include "net/url_request/url_fetcher.h"
9 #include "net/url_request/url_fetcher_delegate.h"
10
11 namespace content {
12 class BrowserContext;
13 }
14
15 // WebUIURLFetcher downloads the content of a file by giving its |url| on WebUI.
16 // Each WebUIURLFetcher is associated with a given |render_process_id,
17 // render_view_id| pair.
18 class WebUIURLFetcher : public net::URLFetcherDelegate {
19 public:
20 // Called when a file URL request is complete.
21 // Parameters:
22 // - whether the request is success.
23 // - If yes, the content of the file.
24 using WebUILoadFileCallback = base::Callback<void(bool, const std::string&)>;
25
26 WebUIURLFetcher(content::BrowserContext* context,
27 const WebUILoadFileCallback& callback);
28 ~WebUIURLFetcher() override;
29
30 void Start(int render_process_id, int render_view_id, const GURL& url);
31
32 private:
33 // net::URLFetcherDelegate:
34 void OnURLFetchComplete(const net::URLFetcher* source) override;
35
36 content::BrowserContext* context_;
37 WebUILoadFileCallback callback_;
38 scoped_ptr<net::URLFetcher> fetcher_;
39
40 DISALLOW_COPY_AND_ASSIGN(WebUIURLFetcher);
41 };
42
43 #endif // EXTENSIONS_BROWSER_WEB_UI_URL_FETCHER_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698