| OLD | NEW |
| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 | 914 |
| 915 void WebContentsImpl::WasRestored() { | 915 void WebContentsImpl::WasRestored() { |
| 916 controller_.SetActive(true); | 916 controller_.SetActive(true); |
| 917 RenderWidgetHostViewPort* rwhv = | 917 RenderWidgetHostViewPort* rwhv = |
| 918 RenderWidgetHostViewPort::FromRWHV(GetRenderWidgetHostView()); | 918 RenderWidgetHostViewPort::FromRWHV(GetRenderWidgetHostView()); |
| 919 if (rwhv) { | 919 if (rwhv) { |
| 920 rwhv->WasRestored(); | 920 rwhv->WasRestored(); |
| 921 #if defined(OS_MACOSX) | 921 #if defined(OS_MACOSX) |
| 922 rwhv->SetActive(true); | 922 rwhv->SetActive(true); |
| 923 #endif | 923 #endif |
| 924 } | 924 } else |
| 925 LOG(WARNING) << "Restoring web contents with no rwhv"; |
| 925 | 926 |
| 926 last_selected_time_ = base::TimeTicks::Now(); | 927 last_selected_time_ = base::TimeTicks::Now(); |
| 927 | 928 |
| 928 FOR_EACH_OBSERVER(WebContentsObserver, observers_, WasRestored()); | 929 FOR_EACH_OBSERVER(WebContentsObserver, observers_, WasRestored()); |
| 929 | 930 |
| 930 // The resize rect might have changed while this was inactive -- send the new | 931 // The resize rect might have changed while this was inactive -- send the new |
| 931 // one to make sure it's up to date. | 932 // one to make sure it's up to date. |
| 932 RenderViewHostImpl* rvh = | 933 RenderViewHostImpl* rvh = |
| 933 static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 934 static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
| 934 if (rvh) { | 935 if (rvh) |
| 935 rvh->ResizeRectChanged(GetRootWindowResizerRect()); | 936 rvh->ResizeRectChanged(GetRootWindowResizerRect()); |
| 936 } | |
| 937 | 937 |
| 938 bool is_visible = true; | 938 bool is_visible = true; |
| 939 content::NotificationService::current()->Notify( | 939 content::NotificationService::current()->Notify( |
| 940 content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED, | 940 content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED, |
| 941 content::Source<WebContents>(this), | 941 content::Source<WebContents>(this), |
| 942 content::Details<bool>(&is_visible)); | 942 content::Details<bool>(&is_visible)); |
| 943 } | 943 } |
| 944 | 944 |
| 945 void WebContentsImpl::WasHidden() { | 945 void WebContentsImpl::WasHidden() { |
| 946 if (!capturing_contents_) { | 946 if (!capturing_contents_) { |
| (...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3074 browser_plugin_host()->embedder_render_process_host(); | 3074 browser_plugin_host()->embedder_render_process_host(); |
| 3075 *embedder_container_id = browser_plugin_host()->instance_id(); | 3075 *embedder_container_id = browser_plugin_host()->instance_id(); |
| 3076 int embedder_process_id = | 3076 int embedder_process_id = |
| 3077 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3077 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
| 3078 if (embedder_process_id != -1) { | 3078 if (embedder_process_id != -1) { |
| 3079 *embedder_channel_name = | 3079 *embedder_channel_name = |
| 3080 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3080 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
| 3081 embedder_process_id); | 3081 embedder_process_id); |
| 3082 } | 3082 } |
| 3083 } | 3083 } |
| OLD | NEW |