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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1943183002: Transfer theme & page background colors between changes of RWHV. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@noflash
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 3892 matching lines...) Expand 10 before | Expand all | Expand 10 after
3903 RenderViewHostChanged(old_host, new_host)); 3903 RenderViewHostChanged(old_host, new_host));
3904 3904
3905 // Ensure that the associated embedder gets cleared after a RenderViewHost 3905 // Ensure that the associated embedder gets cleared after a RenderViewHost
3906 // gets swapped, so we don't reuse the same embedder next time a 3906 // gets swapped, so we don't reuse the same embedder next time a
3907 // RenderViewHost is attached to this WebContents. 3907 // RenderViewHost is attached to this WebContents.
3908 RemoveBrowserPluginEmbedder(); 3908 RemoveBrowserPluginEmbedder();
3909 } 3909 }
3910 3910
3911 void WebContentsImpl::NotifyFrameSwapped(RenderFrameHost* old_host, 3911 void WebContentsImpl::NotifyFrameSwapped(RenderFrameHost* old_host,
3912 RenderFrameHost* new_host) { 3912 RenderFrameHost* new_host) {
3913 // Pass the background color of the old host to the new one. This passes
3914 // on the page background color of the old host (or the theme color if the
3915 // page background color is not set). This avoids flashes of white when
3916 // starting up new_host.
3917 if (old_host && old_host->GetView() && new_host && new_host->GetView()) {
3918 new_host->GetView()->SetBackgroundColor(
3919 old_host->GetView()->background_color());
no sievers 2016/05/17 18:05:43 You said this doesn't work reliably. Does it work
3920 }
3921
3913 FOR_EACH_OBSERVER(WebContentsObserver, 3922 FOR_EACH_OBSERVER(WebContentsObserver,
3914 observers_, 3923 observers_,
3915 RenderFrameHostChanged(old_host, new_host)); 3924 RenderFrameHostChanged(old_host, new_host));
3916 } 3925 }
3917 3926
3918 // TODO(avi): Remove this entire function because this notification is already 3927 // TODO(avi): Remove this entire function because this notification is already
3919 // covered by two observer functions. http://crbug.com/170921 3928 // covered by two observer functions. http://crbug.com/170921
3920 void WebContentsImpl::NotifyDisconnected() { 3929 void WebContentsImpl::NotifyDisconnected() {
3921 if (!notify_disconnection_) 3930 if (!notify_disconnection_)
3922 return; 3931 return;
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
5015 for (RenderViewHost* render_view_host : render_view_host_set) 5024 for (RenderViewHost* render_view_host : render_view_host_set)
5016 render_view_host->OnWebkitPreferencesChanged(); 5025 render_view_host->OnWebkitPreferencesChanged();
5017 } 5026 }
5018 5027
5019 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( 5028 void WebContentsImpl::SetJavaScriptDialogManagerForTesting(
5020 JavaScriptDialogManager* dialog_manager) { 5029 JavaScriptDialogManager* dialog_manager) {
5021 dialog_manager_ = dialog_manager; 5030 dialog_manager_ = dialog_manager;
5022 } 5031 }
5023 5032
5024 } // namespace content 5033 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_base.cc ('k') | content/public/browser/render_widget_host_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698