| 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 "chrome/browser/ui/panels/panel_host.h" | 5 #include "chrome/browser/ui/panels/panel_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/chrome_page_zoom.h" | 10 #include "chrome/browser/chrome_page_zoom.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 const gfx::Size& new_size) { | 194 const gfx::Size& new_size) { |
| 195 panel_->OnContentsAutoResized(new_size); | 195 panel_->OnContentsAutoResized(new_size); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void PanelHost::RenderViewCreated(content::RenderViewHost* render_view_host) { | 198 void PanelHost::RenderViewCreated(content::RenderViewHost* render_view_host) { |
| 199 extensions::WindowController* window = GetExtensionWindowController(); | 199 extensions::WindowController* window = GetExtensionWindowController(); |
| 200 render_view_host->Send(new ExtensionMsg_UpdateBrowserWindowId( | 200 render_view_host->Send(new ExtensionMsg_UpdateBrowserWindowId( |
| 201 render_view_host->GetRoutingID(), window->GetWindowId())); | 201 render_view_host->GetRoutingID(), window->GetWindowId())); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void PanelHost::RenderViewGone(base::TerminationStatus status) { | 204 void PanelHost::RenderProcessGone(base::TerminationStatus status) { |
| 205 CloseContents(web_contents_.get()); | 205 CloseContents(web_contents_.get()); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void PanelHost::WebContentsDestroyed(content::WebContents* web_contents) { | 208 void PanelHost::WebContentsDestroyed(content::WebContents* web_contents) { |
| 209 // Web contents should only be destroyed by us. | 209 // Web contents should only be destroyed by us. |
| 210 CHECK(!web_contents_.get()); | 210 CHECK(!web_contents_.get()); |
| 211 | 211 |
| 212 // Close the panel after we return to the message loop (not immediately, | 212 // Close the panel after we return to the message loop (not immediately, |
| 213 // otherwise, it may destroy this object before the stack has a chance | 213 // otherwise, it may destroy this object before the stack has a chance |
| 214 // to cleanly unwind.) | 214 // to cleanly unwind.) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 257 } |
| 258 | 258 |
| 259 void PanelHost::StopLoading() { | 259 void PanelHost::StopLoading() { |
| 260 content::RecordAction(UserMetricsAction("Stop")); | 260 content::RecordAction(UserMetricsAction("Stop")); |
| 261 web_contents_->Stop(); | 261 web_contents_->Stop(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 void PanelHost::Zoom(content::PageZoom zoom) { | 264 void PanelHost::Zoom(content::PageZoom zoom) { |
| 265 chrome_page_zoom::Zoom(web_contents_.get(), zoom); | 265 chrome_page_zoom::Zoom(web_contents_.get(), zoom); |
| 266 } | 266 } |
| OLD | NEW |