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

Side by Side Diff: chrome/browser/ui/fast_unload_controller.cc

Issue 691823002: Add WebContents source to methods in WebContentsDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/fast_unload_controller.h" 5 #include "chrome/browser/ui/fast_unload_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/devtools/devtools_window.h" 10 #include "chrome/browser/devtools/devtools_window.h"
(...skipping 15 matching lines...) Expand all
26 //////////////////////////////////////////////////////////////////////////////// 26 ////////////////////////////////////////////////////////////////////////////////
27 // DetachedWebContentsDelegate will delete web contents when they close. 27 // DetachedWebContentsDelegate will delete web contents when they close.
28 class FastUnloadController::DetachedWebContentsDelegate 28 class FastUnloadController::DetachedWebContentsDelegate
29 : public content::WebContentsDelegate { 29 : public content::WebContentsDelegate {
30 public: 30 public:
31 DetachedWebContentsDelegate() { } 31 DetachedWebContentsDelegate() { }
32 ~DetachedWebContentsDelegate() override {} 32 ~DetachedWebContentsDelegate() override {}
33 33
34 private: 34 private:
35 // WebContentsDelegate implementation. 35 // WebContentsDelegate implementation.
36 bool ShouldSuppressDialogs() override { 36 bool ShouldSuppressDialogs(content::WebContents* source) override {
37 return true; // Return true so dialogs are suppressed. 37 return true; // Return true so dialogs are suppressed.
38 } 38 }
39 39
40 void CloseContents(content::WebContents* source) override { 40 void CloseContents(content::WebContents* source) override {
41 // Finished detached close. 41 // Finished detached close.
42 // FastUnloadController will observe 42 // FastUnloadController will observe
43 // |NOTIFICATION_WEB_CONTENTS_DISCONNECTED|. 43 // |NOTIFICATION_WEB_CONTENTS_DISCONNECTED|.
44 delete source; 44 delete source;
45 } 45 }
46 46
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 } 473 }
474 474
475 void FastUnloadController::PostTaskForProcessPendingTabs() { 475 void FastUnloadController::PostTaskForProcessPendingTabs() {
476 base::MessageLoop::current()->PostTask( 476 base::MessageLoop::current()->PostTask(
477 FROM_HERE, 477 FROM_HERE,
478 base::Bind(&FastUnloadController::ProcessPendingTabs, 478 base::Bind(&FastUnloadController::ProcessPendingTabs,
479 weak_factory_.GetWeakPtr())); 479 weak_factory_.GetWeakPtr()));
480 } 480 }
481 481
482 } // namespace chrome 482 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | content/browser/device_sensors/device_inertial_sensor_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698