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