| OLD | NEW |
| 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 Loading... |
| 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 virtual ~DetachedWebContentsDelegate() { } | 32 virtual ~DetachedWebContentsDelegate() { } |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 // WebContentsDelegate implementation. | 35 // WebContentsDelegate implementation. |
| 36 virtual bool ShouldSuppressDialogs() OVERRIDE { | 36 virtual bool ShouldSuppressDialogs() override { |
| 37 return true; // Return true so dialogs are suppressed. | 37 return true; // Return true so dialogs are suppressed. |
| 38 } | 38 } |
| 39 | 39 |
| 40 virtual void CloseContents(content::WebContents* source) OVERRIDE { | 40 virtual 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 |
| 47 DISALLOW_COPY_AND_ASSIGN(DetachedWebContentsDelegate); | 47 DISALLOW_COPY_AND_ASSIGN(DetachedWebContentsDelegate); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 //////////////////////////////////////////////////////////////////////////////// | 50 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |