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

Unified Diff: chrome/browser/ui/tab_contents/core_tab_helper.h

Issue 2737893002: Mojoify the RequestThumbnailForContextNode IPC message and reply (Closed)
Patch Set: 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/browser/ui/tab_contents/core_tab_helper.h
diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.h b/chrome/browser/ui/tab_contents/core_tab_helper.h
index 43041d47c78c415202dfd321b39cfe39b4e8192f..d2231c021aceda5235b772a0173adc80567710c6 100644
--- a/chrome/browser/ui/tab_contents/core_tab_helper.h
+++ b/chrome/browser/ui/tab_contents/core_tab_helper.h
@@ -11,6 +11,7 @@
#include "base/id_map.h"
#include "base/macros.h"
#include "base/time/time.h"
+#include "chrome/common/thumbnail_capturer.mojom.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
#include "ui/gfx/geometry/size.h"
@@ -23,7 +24,7 @@ class CoreTabHelper : public content::WebContentsObserver,
public content::WebContentsUserData<CoreTabHelper> {
public:
using ContextNodeThumbnailCallback =
- base::Callback<void(const std::string&, const gfx::Size&)>;
+ chrome::mojom::ThumbnailCapturer::RequestThumbnailForContextNodeCallback;
~CoreTabHelper() override;
@@ -58,8 +59,8 @@ class CoreTabHelper : public content::WebContentsObserver,
const GURL& src_url);
void RequestThumbnailForContextNode(
content::RenderFrameHost* render_frame_host,
- int minimum_size,
- gfx::Size maximum_size,
+ int thumbnail_min_area_pixels,
+ gfx::Size thumbnail_max_size_pixels,
const ContextNodeThumbnailCallback& callback);
CoreTabHelperDelegate* delegate() const { return delegate_; }
@@ -85,12 +86,13 @@ class CoreTabHelper : public content::WebContentsObserver,
void WebContentsDestroyed() override;
void BeforeUnloadFired(const base::TimeTicks& proceed_time) override;
void BeforeUnloadDialogCancelled() override;
- bool OnMessageReceived(const IPC::Message& message,
- content::RenderFrameHost* render_frame_host) override;
- void OnRequestThumbnailForContextNodeACK(const std::string& thumbnail_data,
- const gfx::Size& original_size,
- int callback_id);
+ void OnThumbnailForContextNodeReceived(
+ int interface_id,
+ const ContextNodeThumbnailCallback& callback,
+ const std::string& thumbnail_data,
+ const gfx::Size& original_size);
+
void DoSearchByImageInNewTab(const GURL& src_url,
const std::string& thumbnail_data,
const gfx::Size& original_size);
@@ -115,7 +117,8 @@ class CoreTabHelper : public content::WebContentsObserver,
// (full-page plugins for now only) permissions.
int content_restrictions_;
- IDMap<std::unique_ptr<ContextNodeThumbnailCallback>> thumbnail_callbacks_;
+ IDMap<std::unique_ptr<chrome::mojom::ThumbnailCapturerPtr>>
+ thumbnail_capturers_;
DISALLOW_COPY_AND_ASSIGN(CoreTabHelper);
};

Powered by Google App Engine
This is Rietveld 408576698