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

Unified Diff: chrome/renderer/chrome_render_frame_observer.h

Issue 2737893002: Mojoify the RequestThumbnailForContextNode IPC message and reply (Closed)
Patch Set: Remove watcher; use ContextMenuWaiter Created 3 years, 9 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: chrome/renderer/chrome_render_frame_observer.h
diff --git a/chrome/renderer/chrome_render_frame_observer.h b/chrome/renderer/chrome_render_frame_observer.h
index a9dad7bb1b30c6bf0ca5efa8ab522ef0486eb7c4..53c0d248fa31664c6a8893e338ef5fa9deda34ff 100644
--- a/chrome/renderer/chrome_render_frame_observer.h
+++ b/chrome/renderer/chrome_render_frame_observer.h
@@ -8,7 +8,9 @@
#include "base/macros.h"
#include "base/timer/timer.h"
#include "chrome/common/prerender_types.h"
+#include "chrome/common/thumbnail_capturer.mojom.h"
#include "content/public/renderer/render_frame_observer.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
namespace gfx {
class Size;
@@ -24,7 +26,8 @@ class TranslateHelper;
// This class holds the Chrome specific parts of RenderFrame, and has the same
// lifetime.
-class ChromeRenderFrameObserver : public content::RenderFrameObserver {
+class ChromeRenderFrameObserver : public content::RenderFrameObserver,
+ public chrome::mojom::ThumbnailCapturer {
public:
explicit ChromeRenderFrameObserver(content::RenderFrame* render_frame);
~ChromeRenderFrameObserver() override;
@@ -41,6 +44,14 @@ class ChromeRenderFrameObserver : public content::RenderFrameObserver {
void DidMeaningfulLayout(blink::WebMeaningfulLayout layout_type) override;
void OnDestruct() override;
+ // chrome::mojom::ThumbnailCapturer:
+ void OnThumbnailCapturerRequest(
+ chrome::mojom::ThumbnailCapturerRequest request);
+ void RequestThumbnailForContextNode(
+ int32_t thumbnail_min_area_pixels,
+ const gfx::Size& thumbnail_max_size_pixels,
+ const RequestThumbnailForContextNodeCallback& callback) override;
+
// IPC handlers
void OnSetIsPrerendering(prerender::PrerenderMode mode);
void OnRequestReloadImageForContextNode();
@@ -65,6 +76,9 @@ class ChromeRenderFrameObserver : public content::RenderFrameObserver {
translate::TranslateHelper* translate_helper_;
safe_browsing::PhishingClassifierDelegate* phishing_classifier_;
+ mojo::BindingSet<chrome::mojom::ThumbnailCapturer>
+ thumbnail_capturer_bindings_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeRenderFrameObserver);
};

Powered by Google App Engine
This is Rietveld 408576698