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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h

Issue 1558553002: Lo-Fi snackbar should only be shown for the first q=low response of a page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h
index 2d96ea28e837d5f2624a15a8b1f93694de7926fb..de383f456cc5d0bda1185f12084e6468359708d5 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h
@@ -21,6 +21,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_storage_delegate.h"
#include "components/data_reduction_proxy/core/common/lofi_decider.h"
+#include "components/data_reduction_proxy/core/common/lofi_ui_service.h"
namespace base {
class Value;
@@ -176,6 +177,13 @@ class DataReductionProxyIOData : public DataReductionProxyEventStorageDelegate {
lofi_decider_ = std::move(lofi_decider);
}
+ LoFiUIService* lofi_ui_service() const { return lofi_ui_service_.get(); }
+
+ // Takes ownership of |lofi_ui_service|.
+ void set_lofi_ui_service(scoped_ptr<LoFiUIService> lofi_ui_service) const {
+ lofi_ui_service_ = std::move(lofi_ui_service);
+ }
+
private:
friend class TestDataReductionProxyIOData;
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyIODataTest, TestConstruction);
@@ -216,6 +224,9 @@ class DataReductionProxyIOData : public DataReductionProxyEventStorageDelegate {
// Handles getting if a request is in Lo-Fi mode.
mutable scoped_ptr<LoFiDecider> lofi_decider_;
+ // Handles showing Lo-Fi UI when a Lo-Fi response is received.
+ mutable scoped_ptr<LoFiUIService> lofi_ui_service_;
+
// Creates Data Reduction Proxy-related events for logging.
scoped_ptr<DataReductionProxyEventCreator> event_creator_;

Powered by Google App Engine
This is Rietveld 408576698