Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_PREVIEWS_CORE_PREVIEWS_DECIDER_H_ | 5 #ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_DECIDER_H_ |
| 6 #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_DECIDER_H_ | 6 #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_DECIDER_H_ |
| 7 | 7 |
| 8 #include "components/previews/core/previews_experiments.h" | 8 #include "components/previews/core/previews_experiments.h" |
| 9 | 9 |
| 10 #include "net/nqe/effective_connection_type.h" | |
| 11 | |
| 10 namespace net { | 12 namespace net { |
| 11 class URLRequest; | 13 class URLRequest; |
| 12 } | 14 } |
| 13 | 15 |
| 14 namespace previews { | 16 namespace previews { |
| 15 | 17 |
| 16 class PreviewsDecider { | 18 class PreviewsDecider { |
| 17 public: | 19 public: |
| 18 // Whether |request| is allowed to show a preview of |type|. | 20 // Whether |request| is allowed to show a preview of |type|. Previews that do |
| 21 // not supply a network quality in | |
| 22 // GetEffectiveConnectionTypeThresholdForPreviewsType() should check the | |
| 23 // network quality before calling ShouldAllowPreview. | |
| 24 virtual bool ShouldAllowPreview( | |
|
tbansal1
2017/05/05 20:34:39
add comments for the args.
RyanSturm
2017/05/05 20:51:35
Done.
| |
| 25 const net::URLRequest& request, | |
| 26 PreviewsType type, | |
| 27 net::EffectiveConnectionType effective_connection_type) const = 0; | |
| 28 | |
| 29 // Same as above, but uses the previews default EffectiveConnectionType. | |
| 19 virtual bool ShouldAllowPreview(const net::URLRequest& request, | 30 virtual bool ShouldAllowPreview(const net::URLRequest& request, |
| 20 PreviewsType type) const = 0; | 31 PreviewsType type) const = 0; |
| 21 | 32 |
| 22 protected: | 33 protected: |
| 23 PreviewsDecider() {} | 34 PreviewsDecider() {} |
| 24 virtual ~PreviewsDecider() {} | 35 virtual ~PreviewsDecider() {} |
| 25 }; | 36 }; |
| 26 | 37 |
| 27 } // namespace previews | 38 } // namespace previews |
| 28 | 39 |
| 29 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_DECIDER_H_ | 40 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_DECIDER_H_ |
| OLD | NEW |