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

Side by Side Diff: chrome/browser/ui/panels/panel_host.cc

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months 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 | Annotate | Revision Log
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 "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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 CloseContents(web_contents_.get()); 197 CloseContents(web_contents_.get());
198 } 198 }
199 199
200 void PanelHost::WebContentsDestroyed(content::WebContents* web_contents) { 200 void PanelHost::WebContentsDestroyed(content::WebContents* web_contents) {
201 // Web contents should only be destroyed by us. 201 // Web contents should only be destroyed by us.
202 CHECK(!web_contents_.get()); 202 CHECK(!web_contents_.get());
203 203
204 // Close the panel after we return to the message loop (not immediately, 204 // Close the panel after we return to the message loop (not immediately,
205 // otherwise, it may destroy this object before the stack has a chance 205 // otherwise, it may destroy this object before the stack has a chance
206 // to cleanly unwind.) 206 // to cleanly unwind.)
207 MessageLoop::current()->PostTask( 207 base::MessageLoop::current()->PostTask(
208 FROM_HERE, 208 FROM_HERE,
209 base::Bind(&PanelHost::ClosePanel, weak_factory_.GetWeakPtr())); 209 base::Bind(&PanelHost::ClosePanel, weak_factory_.GetWeakPtr()));
210 } 210 }
211 211
212 void PanelHost::ClosePanel() { 212 void PanelHost::ClosePanel() {
213 panel_->Close(); 213 panel_->Close();
214 } 214 }
215 215
216 bool PanelHost::OnMessageReceived(const IPC::Message& message) { 216 bool PanelHost::OnMessageReceived(const IPC::Message& message) {
217 bool handled = true; 217 bool handled = true;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 250
251 void PanelHost::StopLoading() { 251 void PanelHost::StopLoading() {
252 content::RecordAction(UserMetricsAction("Stop")); 252 content::RecordAction(UserMetricsAction("Stop"));
253 web_contents_->Stop(); 253 web_contents_->Stop();
254 } 254 }
255 255
256 void PanelHost::Zoom(content::PageZoom zoom) { 256 void PanelHost::Zoom(content::PageZoom zoom) {
257 chrome_page_zoom::Zoom(web_contents_.get(), zoom); 257 chrome_page_zoom::Zoom(web_contents_.get(), zoom);
258 } 258 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_drag_browsertest.cc ('k') | chrome/browser/ui/panels/panel_mouse_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698