| 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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 void PanelHost::RenderViewCreated(content::RenderViewHost* render_view_host) { | 201 void PanelHost::RenderViewCreated(content::RenderViewHost* render_view_host) { |
| 202 extensions::WindowController* window = GetExtensionWindowController(); | 202 extensions::WindowController* window = GetExtensionWindowController(); |
| 203 render_view_host->Send(new ExtensionMsg_UpdateBrowserWindowId( | 203 render_view_host->Send(new ExtensionMsg_UpdateBrowserWindowId( |
| 204 render_view_host->GetRoutingID(), window->GetWindowId())); | 204 render_view_host->GetRoutingID(), window->GetWindowId())); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void PanelHost::RenderProcessGone(base::TerminationStatus status) { | 207 void PanelHost::RenderProcessGone(base::TerminationStatus status) { |
| 208 CloseContents(web_contents_.get()); | 208 CloseContents(web_contents_.get()); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void PanelHost::WebContentsDestroyed(content::WebContents* web_contents) { | 211 void PanelHost::WebContentsDestroyed() { |
| 212 // Web contents should only be destroyed by us. | 212 // Web contents should only be destroyed by us. |
| 213 CHECK(!web_contents_.get()); | 213 CHECK(!web_contents_.get()); |
| 214 | 214 |
| 215 // Close the panel after we return to the message loop (not immediately, | 215 // Close the panel after we return to the message loop (not immediately, |
| 216 // otherwise, it may destroy this object before the stack has a chance | 216 // otherwise, it may destroy this object before the stack has a chance |
| 217 // to cleanly unwind.) | 217 // to cleanly unwind.) |
| 218 base::MessageLoop::current()->PostTask( | 218 base::MessageLoop::current()->PostTask( |
| 219 FROM_HERE, | 219 FROM_HERE, |
| 220 base::Bind(&PanelHost::ClosePanel, weak_factory_.GetWeakPtr())); | 220 base::Bind(&PanelHost::ClosePanel, weak_factory_.GetWeakPtr())); |
| 221 } | 221 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 260 } |
| 261 | 261 |
| 262 void PanelHost::StopLoading() { | 262 void PanelHost::StopLoading() { |
| 263 content::RecordAction(UserMetricsAction("Stop")); | 263 content::RecordAction(UserMetricsAction("Stop")); |
| 264 web_contents_->Stop(); | 264 web_contents_->Stop(); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void PanelHost::Zoom(content::PageZoom zoom) { | 267 void PanelHost::Zoom(content::PageZoom zoom) { |
| 268 chrome_page_zoom::Zoom(web_contents_.get(), zoom); | 268 chrome_page_zoom::Zoom(web_contents_.get(), zoom); |
| 269 } | 269 } |
| OLD | NEW |