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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2085973004: Color: Remove ViewMsg_ColorProfile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't change profile yet Created 4 years, 6 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: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index aaba6a36d783f589d00b6471641ff44d78294de9..7a1ee03f63afe170922169e10de1a5eae78dcea1 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -189,7 +189,6 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
is_hidden_(hidden),
repaint_ack_pending_(false),
resize_ack_pending_(false),
- color_profile_out_of_date_(false),
auto_resize_enabled_(false),
waiting_for_screen_rects_ack_(false),
needs_repainting_on_restore_(false),
@@ -625,14 +624,10 @@ void RenderWidgetHostImpl::WasResized() {
// it's web contents is being deleted.
if (resize_ack_pending_ || !process_->HasConnection() || !view_ ||
!renderer_initialized_ || auto_resize_enabled_ || !delegate_) {
- if (resize_ack_pending_ && color_profile_out_of_date_)
- DispatchColorProfile();
return;
}
std::unique_ptr<ResizeParams> params(new ResizeParams);
- if (color_profile_out_of_date_)
- DispatchColorProfile();
if (!GetResizeParams(params.get()))
return;
@@ -648,44 +643,6 @@ void RenderWidgetHostImpl::WasResized() {
delegate_->RenderWidgetWasResized(this, width_changed);
}
-void RenderWidgetHostImpl::DispatchColorProfile() {
-#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
- static bool image_profiles = base::CommandLine::ForCurrentProcess()->
- HasSwitch(switches::kEnableImageColorProfiles);
- if (!image_profiles)
- return;
-#if defined(OS_WIN)
- // Windows will read disk to get the color profile data if needed, so
- // dispatch the SendColorProfile() work off the UI thread.
- BrowserThread::PostBlockingPoolTask(
- FROM_HERE,
- base::Bind(&RenderWidgetHostImpl::SendColorProfile,
- weak_factory_.GetWeakPtr()));
-#elif !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
- // Only support desktop Mac and Linux at this time.
- SendColorProfile();
-#endif
-#endif
-}
-
-void RenderWidgetHostImpl::SendColorProfile() {
- if (!view_ || !delegate_)
- return;
- DCHECK(!view_->GetRequestedRendererSize().IsEmpty());
-#if defined(OS_WIN)
- DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO));
-#endif
- std::vector<char> color_profile;
- if (!GetScreenColorProfile(&color_profile))
- return;
- if (!renderer_initialized_ || !process_->HasConnection())
- return;
- if (!Send(new ViewMsg_ColorProfile(routing_id_, color_profile)))
- return;
- color_profile_out_of_date_ = false;
-}
-
void RenderWidgetHostImpl::ResizeRectChanged(const gfx::Rect& new_rect) {
Send(new ViewMsg_ChangeResizeRect(routing_id_, new_rect));
}
@@ -1257,14 +1214,6 @@ void RenderWidgetHostImpl::GetWebScreenInfo(blink::WebScreenInfo* result) {
input_router_->SetDeviceScaleFactor(result->deviceScaleFactor);
}
-bool RenderWidgetHostImpl::GetScreenColorProfile(
- std::vector<char>* color_profile) {
- DCHECK(color_profile->empty());
- if (view_)
- return view_->GetScreenColorProfile(color_profile);
- return false;
-}
-
void RenderWidgetHostImpl::HandleCompositorProto(
const std::vector<uint8_t>& proto) {
DCHECK(!proto.empty());
@@ -1272,8 +1221,6 @@ void RenderWidgetHostImpl::HandleCompositorProto(
}
void RenderWidgetHostImpl::NotifyScreenInfoChanged() {
- color_profile_out_of_date_ = true;
-
if (delegate_)
delegate_->ScreenInfoChanged();

Powered by Google App Engine
This is Rietveld 408576698