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

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

Issue 2194243002: Suppress JavaScript dialogs when a tab puts itself into fullscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch fullscreen call Created 4 years, 4 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 18 matching lines...) Expand all
29 //////////////////////////////////////////////////////////////////////////////// 29 ////////////////////////////////////////////////////////////////////////////////
30 // DetachedWebContentsDelegate will delete web contents when they close. 30 // DetachedWebContentsDelegate will delete web contents when they close.
31 class FastUnloadController::DetachedWebContentsDelegate 31 class FastUnloadController::DetachedWebContentsDelegate
32 : public content::WebContentsDelegate { 32 : public content::WebContentsDelegate {
33 public: 33 public:
34 DetachedWebContentsDelegate() { } 34 DetachedWebContentsDelegate() { }
35 ~DetachedWebContentsDelegate() override {} 35 ~DetachedWebContentsDelegate() override {}
36 36
37 private: 37 private:
38 // WebContentsDelegate implementation. 38 // WebContentsDelegate implementation.
39 bool ShouldSuppressDialogs(content::WebContents* source) override { 39 bool ShouldSuppressDialogs(content::WebContents* source,
40 bool before_unload) override {
40 return true; // Return true so dialogs are suppressed. 41 return true; // Return true so dialogs are suppressed.
41 } 42 }
42 43
43 void CloseContents(content::WebContents* source) override { 44 void CloseContents(content::WebContents* source) override {
44 // Finished detached close. 45 // Finished detached close.
45 // FastUnloadController will observe 46 // FastUnloadController will observe
46 // |NOTIFICATION_WEB_CONTENTS_DISCONNECTED|. 47 // |NOTIFICATION_WEB_CONTENTS_DISCONNECTED|.
47 delete source; 48 delete source;
48 } 49 }
49 50
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 } 473 }
473 } 474 }
474 475
475 void FastUnloadController::PostTaskForProcessPendingTabs() { 476 void FastUnloadController::PostTaskForProcessPendingTabs() {
476 base::ThreadTaskRunnerHandle::Get()->PostTask( 477 base::ThreadTaskRunnerHandle::Get()->PostTask(
477 FROM_HERE, base::Bind(&FastUnloadController::ProcessPendingTabs, 478 FROM_HERE, base::Bind(&FastUnloadController::ProcessPendingTabs,
478 weak_factory_.GetWeakPtr())); 479 weak_factory_.GetWeakPtr()));
479 } 480 }
480 481
481 } // namespace chrome 482 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698