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

Side by Side Diff: components/dom_distiller/core/fake_distiller.h

Issue 146843010: Add support for multipage distillation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
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 COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_ 6 #define COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_
7 7
8 #include "components/dom_distiller/core/article_entry.h" 8 #include "components/dom_distiller/core/article_entry.h"
9 #include "components/dom_distiller/core/distiller.h" 9 #include "components/dom_distiller/core/distiller.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 18 matching lines...) Expand all
29 public: 29 public:
30 FakeDistiller(bool execute_callback); 30 FakeDistiller(bool execute_callback);
31 virtual ~FakeDistiller(); 31 virtual ~FakeDistiller();
32 MOCK_METHOD0(Die, void()); 32 MOCK_METHOD0(Die, void());
33 33
34 virtual void DistillPage(const GURL& url, 34 virtual void DistillPage(const GURL& url,
35 const DistillerCallback& callback) OVERRIDE { 35 const DistillerCallback& callback) OVERRIDE {
36 url_ = url; 36 url_ = url;
37 callback_ = callback; 37 callback_ = callback;
38 if (execute_callback_) { 38 if (execute_callback_) {
39 RunDistillerCallback(make_scoped_ptr(new DistilledPageProto)); 39 RunDistillerCallback(make_scoped_ptr(new DistilledArticleProto));
40 } 40 }
41 } 41 }
42 42
43 void RunDistillerCallback(scoped_ptr<DistilledPageProto> proto); 43 void RunDistillerCallback(scoped_ptr<DistilledArticleProto> proto);
44 44
45 GURL GetUrl() { return url_; } 45 GURL GetUrl() { return url_; }
46 46
47 DistillerCallback GetCallback() { return callback_; } 47 DistillerCallback GetCallback() { return callback_; }
48 48
49 private: 49 private:
50 void RunDistillerCallbackInternal(scoped_ptr<DistilledPageProto> proto); 50 void RunDistillerCallbackInternal(scoped_ptr<DistilledArticleProto> proto);
51 51
52 bool execute_callback_; 52 bool execute_callback_;
53 GURL url_; 53 GURL url_;
54 DistillerCallback callback_; 54 DistillerCallback callback_;
55 }; 55 };
56 56
57 } // namespace test 57 } // namespace test
58 } // namespace dom_distiller 58 } // namespace dom_distiller
59 59
60 #endif // COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_ 60 #endif // COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698