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

Side by Side Diff: components/offline_pages/content/background_loader/background_loader_contents.h

Issue 2534673002: [Offline pages] Create offliner that uses background loader (Closed)
Patch Set: bleh it works now Created 4 years 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_OFFLINE_PAGES_CONTENT_BACKGROUND_LOADER_BACKGROUND_LOADER_CON TENTS_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_CONTENT_BACKGROUND_LOADER_BACKGROUND_LOADER_CON TENTS_H_
6 #define COMPONENTS_OFFLINE_PAGES_CONTENT_BACKGROUND_LOADER_BACKGROUND_LOADER_CON TENTS_H_ 6 #define COMPONENTS_OFFLINE_PAGES_CONTENT_BACKGROUND_LOADER_BACKGROUND_LOADER_CON TENTS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/public/browser/web_contents_delegate.h" 10 #include "content/public/browser/web_contents_delegate.h"
(...skipping 10 matching lines...) Expand all
21 // a renderer but does not have any visible display. 21 // a renderer but does not have any visible display.
22 class BackgroundLoaderContents : public content::WebContentsDelegate { 22 class BackgroundLoaderContents : public content::WebContentsDelegate {
23 public: 23 public:
24 // Creates BackgroundLoaderContents with specified |browser_context|. Uses 24 // Creates BackgroundLoaderContents with specified |browser_context|. Uses
25 // default session storage space. 25 // default session storage space.
26 explicit BackgroundLoaderContents(content::BrowserContext* browser_context); 26 explicit BackgroundLoaderContents(content::BrowserContext* browser_context);
27 ~BackgroundLoaderContents() override; 27 ~BackgroundLoaderContents() override;
28 28
29 // Loads the URL in a WebContents. Will call observe on all current observers 29 // Loads the URL in a WebContents. Will call observe on all current observers
30 // with the created WebContents. 30 // with the created WebContents.
31 void LoadPage(const GURL& url); 31 virtual void LoadPage(const GURL& url);
32 // Cancels loading of the current page. Calls Close() on internal WebContents. 32 // Cancels loading of the current page. Calls Close() on internal WebContents.
33 void Cancel(); 33 virtual void Cancel();
34 // Returns the inner web contents. 34 // Returns the inner web contents.
35 content::WebContents* web_contents() { return web_contents_.get(); } 35 content::WebContents* web_contents() { return web_contents_.get(); }
36 36
37 // content::WebContentsDelegate implementation: 37 // content::WebContentsDelegate implementation:
38 bool IsNeverVisible(content::WebContents* web_contents) override; 38 bool IsNeverVisible(content::WebContents* web_contents) override;
39 void CloseContents(content::WebContents* source) override; 39 void CloseContents(content::WebContents* source) override;
40 bool ShouldSuppressDialogs(content::WebContents* source) override; 40 bool ShouldSuppressDialogs(content::WebContents* source) override;
41 bool ShouldFocusPageAfterCrash() override; 41 bool ShouldFocusPageAfterCrash() override;
42 void CanDownload(const GURL& url, 42 void CanDownload(const GURL& url,
43 const std::string& request_method, 43 const std::string& request_method,
(...skipping 26 matching lines...) Expand all
70 void RequestMediaAccessPermission( 70 void RequestMediaAccessPermission(
71 content::WebContents* contents, 71 content::WebContents* contents,
72 const content::MediaStreamRequest& request, 72 const content::MediaStreamRequest& request,
73 const content::MediaResponseCallback& callback) override; 73 const content::MediaResponseCallback& callback) override;
74 bool CheckMediaAccessPermission(content::WebContents* contents, 74 bool CheckMediaAccessPermission(content::WebContents* contents,
75 const GURL& security_origin, 75 const GURL& security_origin,
76 content::MediaStreamType type) override; 76 content::MediaStreamType type) override;
77 77
78 private: 78 private:
79 friend class BackgroundLoaderContentsTest; 79 friend class BackgroundLoaderContentsTest;
80 friend class BackgroundLoaderContentsStub;
81
80 BackgroundLoaderContents(); 82 BackgroundLoaderContents();
81 83
82 std::unique_ptr<content::WebContents> web_contents_; 84 std::unique_ptr<content::WebContents> web_contents_;
83 content::BrowserContext* browser_context_; 85 content::BrowserContext* browser_context_;
84 86
85 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderContents); 87 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderContents);
86 }; 88 };
87 89
88 } // namespace background_loader 90 } // namespace background_loader
89 #endif // COMPONENTS_OFFLINE_PAGES_CONTENT_BACKGROUND_LOADER_BACKGROUND_LOADER_ CONTENTS_H_ 91 #endif // COMPONENTS_OFFLINE_PAGES_CONTENT_BACKGROUND_LOADER_BACKGROUND_LOADER_ CONTENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698