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

Unified Diff: chrome/browser/ui/search/instant_unload_handler.h

Issue 137993020: (Try 2) InstantExtended: remove dead code related to the non-cacheable NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable InstantPolicyTests Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/search/instant_test_utils.cc ('k') | chrome/browser/ui/search/instant_unload_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/instant_unload_handler.h
diff --git a/chrome/browser/ui/search/instant_unload_handler.h b/chrome/browser/ui/search/instant_unload_handler.h
deleted file mode 100644
index fa6b264674a0b986dde0a55ebdba4357f71a50c9..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/search/instant_unload_handler.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_UNLOAD_HANDLER_H_
-#define CHROME_BROWSER_UI_SEARCH_INSTANT_UNLOAD_HANDLER_H_
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/memory/scoped_vector.h"
-
-class Browser;
-
-namespace content {
-class WebContents;
-}
-
-// InstantUnloadHandler ensures that it runs the BeforeUnload/Unload Handlers
-// (BUH) of a page if the page is replaced by an Instant overlay.
-//
-// Why is this needed? Say the user is looking at a page P. They then try to
-// navigate to another page Q. Consider what happens with and without Instant:
-//
-// Without Instant: Before the navigation is committed, P's BUH are run. If P's
-// BUH return a string (instead of the default null), the user is prompted to
-// "Stay or Leave?". If the user clicks "Stay", the navigation is cancelled,
-// and the user remains on P.
-//
-// With Instant: The navigation to Q has already happened, since Q is being
-// shown as a preview (overlay). When the user "commits" the overlay, it's too
-// late to cancel Q based on P's BUH. So, Instant just replaces P with Q and
-// passes P to InstantUnloadHandler::RunUnloadListenersOrDestroy(). This class
-// runs P's BUH in the background. If the "Stay or Leave?" dialog needs to be
-// shown, it adds P back onto the tabstrip, next to Q. Otherwise, P is deleted.
-class InstantUnloadHandler {
- public:
- explicit InstantUnloadHandler(Browser* browser);
- ~InstantUnloadHandler();
-
- // See class description for details on what this does.
- void RunUnloadListenersOrDestroy(scoped_ptr<content::WebContents> contents,
- int index);
-
- private:
- class WebContentsDelegateImpl;
-
- // Invoked if the tab is to be shown, at |index| on the tab strip. This
- // happens if the beforeunload listener returns a string.
- void Activate(WebContentsDelegateImpl* delegate,
- scoped_ptr<content::WebContents> contents,
- int index);
-
- // Destroys the old tab. This is invoked if script tries to close the page.
- void Destroy(WebContentsDelegateImpl* delegate);
-
- // TODO(sky): Browser really needs to wait to close until there are no more
- // tabs managed by InstantUnloadHandler.
- Browser* const browser_;
-
- ScopedVector<WebContentsDelegateImpl> delegates_;
-
- DISALLOW_COPY_AND_ASSIGN(InstantUnloadHandler);
-};
-
-#endif // CHROME_BROWSER_UI_SEARCH_INSTANT_UNLOAD_HANDLER_H_
« no previous file with comments | « chrome/browser/ui/search/instant_test_utils.cc ('k') | chrome/browser/ui/search/instant_unload_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698