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

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

Issue 2466413009: Propagate view background color when changing visible web contents. (Closed)
Patch Set: none Created 4 years, 1 month 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 3936 matching lines...) Expand 10 before | Expand all | Expand 10 after
3947 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP; 3947 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP;
3948 NotificationDetails det = NotificationService::NoDetails(); 3948 NotificationDetails det = NotificationService::NoDetails();
3949 if (details) 3949 if (details)
3950 det = Details<LoadNotificationDetails>(details); 3950 det = Details<LoadNotificationDetails>(details);
3951 NotificationService::current()->Notify( 3951 NotificationService::current()->Notify(
3952 type, Source<NavigationController>(&controller_), det); 3952 type, Source<NavigationController>(&controller_), det);
3953 } 3953 }
3954 3954
3955 void WebContentsImpl::NotifyViewSwapped(RenderViewHost* old_host, 3955 void WebContentsImpl::NotifyViewSwapped(RenderViewHost* old_host,
3956 RenderViewHost* new_host) { 3956 RenderViewHost* new_host) {
3957 if (old_host && new_host) {
3958 RenderWidgetHostView* old_view = old_host->GetWidget()->GetView();
3959 RenderWidgetHostView* new_view = new_host->GetWidget()->GetView();
nasko 2016/11/09 20:18:58 I would put this code in WebContentsImpl::NotifyFr
chrishtr 2016/11/09 21:45:21 Done.
3960 if (old_view && new_view)
3961 new_view->SetBackgroundColor(old_view->background_color());
clamy 2016/11/09 15:56:35 Mmh I think this happens after we've swapped the v
nasko 2016/11/09 20:18:58 It happens in the same event loop as part of commi
chrishtr 2016/11/09 21:45:21 Since it's the same event loop, there is no flash.
3962 }
3957 // After sending out a swap notification, we need to send a disconnect 3963 // After sending out a swap notification, we need to send a disconnect
3958 // notification so that clients that pick up a pointer to |this| can NULL the 3964 // notification so that clients that pick up a pointer to |this| can NULL the
3959 // pointer. See Bug 1230284. 3965 // pointer. See Bug 1230284.
3960 notify_disconnection_ = true; 3966 notify_disconnection_ = true;
3961 for (auto& observer : observers_) 3967 for (auto& observer : observers_)
3962 observer.RenderViewHostChanged(old_host, new_host); 3968 observer.RenderViewHostChanged(old_host, new_host);
3963 3969
3964 // Ensure that the associated embedder gets cleared after a RenderViewHost 3970 // Ensure that the associated embedder gets cleared after a RenderViewHost
3965 // gets swapped, so we don't reuse the same embedder next time a 3971 // gets swapped, so we don't reuse the same embedder next time a
3966 // RenderViewHost is attached to this WebContents. 3972 // RenderViewHost is attached to this WebContents.
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
5181 dialog_manager_ = dialog_manager; 5187 dialog_manager_ = dialog_manager;
5182 } 5188 }
5183 5189
5184 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { 5190 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) {
5185 auto it = binding_sets_.find(interface_name); 5191 auto it = binding_sets_.find(interface_name);
5186 if (it != binding_sets_.end()) 5192 if (it != binding_sets_.end())
5187 binding_sets_.erase(it); 5193 binding_sets_.erase(it);
5188 } 5194 }
5189 5195
5190 } // namespace content 5196 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698