OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 COMPONENTS_DATA_REDUCTION_PROXY_CONTENT_RENDERER_CONTENT_PREVIEWS_RENDER
_FRAME_OBSERVER_H_ |
| 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CONTENT_RENDERER_CONTENT_PREVIEWS_RENDER
_FRAME_OBSERVER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "content/public/common/previews_state.h" |
| 10 #include "content/public/renderer/render_frame_observer.h" |
| 11 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 12 |
| 13 namespace data_reduction_proxy { |
| 14 |
| 15 // This class is created by ChromeRenderFrameObserver, and it class manages its |
| 16 // own lifetime. It deletes itself when the RenderFrame it is observing goes |
| 17 // away. |
| 18 class ContentPreviewsRenderFrameObserver : public content::RenderFrameObserver { |
| 19 public: |
| 20 ContentPreviewsRenderFrameObserver(content::RenderFrame* render_frame); |
| 21 ~ContentPreviewsRenderFrameObserver() override; |
| 22 |
| 23 static content::PreviewsState GetPreviewsStateFromResponse( |
| 24 content::PreviewsState original_state, |
| 25 const blink::WebURLResponse& web_url_response); |
| 26 |
| 27 private: |
| 28 // content::RenderFrameObserver: |
| 29 void OnDestruct() override; |
| 30 void DidCommitProvisionalLoad(bool is_new_navigation, |
| 31 bool is_same_document_navigation) override; |
| 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(ContentPreviewsRenderFrameObserver); |
| 34 }; |
| 35 |
| 36 } // namespace data_reduction_proxy |
| 37 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CONTENT_RENDERER_CONTENT_PREVIEWS_REN
DER_FRAME_OBSERVER_H_ |
OLD | NEW |