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

Side by Side Diff: chrome/browser/instant/instant_unload_handler.cc

Issue 10698068: chrome: Put browser_navigator.h into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: already in chrome namespace Created 8 years, 5 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/instant/instant_unload_handler.h" 5 #include "chrome/browser/instant/instant_unload_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_navigator.h" 10 #include "chrome/browser/ui/browser_navigator.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 // TODO: Decide if we really want false here; false is used for tab closes, 88 // TODO: Decide if we really want false here; false is used for tab closes,
89 // and is needed so that the tab correctly closes but it doesn't really match 89 // and is needed so that the tab correctly closes but it doesn't really match
90 // what's logically happening. 90 // what's logically happening.
91 tab->web_contents()->GetRenderViewHost()->FirePageBeforeUnload(false); 91 tab->web_contents()->GetRenderViewHost()->FirePageBeforeUnload(false);
92 } 92 }
93 93
94 void InstantUnloadHandler::Activate(WebContentsDelegateImpl* delegate) { 94 void InstantUnloadHandler::Activate(WebContentsDelegateImpl* delegate) {
95 // Take ownership of the TabContents from the delegate. 95 // Take ownership of the TabContents from the delegate.
96 TabContents* tab = delegate->ReleaseTab(); 96 TabContents* tab = delegate->ReleaseTab();
97 browser::NavigateParams params(browser_, tab); 97 chrome::NavigateParams params(browser_, tab);
98 params.disposition = NEW_FOREGROUND_TAB; 98 params.disposition = NEW_FOREGROUND_TAB;
99 params.tabstrip_index = delegate->index(); 99 params.tabstrip_index = delegate->index();
100 100
101 // Remove (and delete) the delegate. 101 // Remove (and delete) the delegate.
102 ScopedVector<WebContentsDelegateImpl>::iterator i = 102 ScopedVector<WebContentsDelegateImpl>::iterator i =
103 std::find(delegates_.begin(), delegates_.end(), delegate); 103 std::find(delegates_.begin(), delegates_.end(), delegate);
104 DCHECK(i != delegates_.end()); 104 DCHECK(i != delegates_.end());
105 delegates_.erase(i); 105 delegates_.erase(i);
106 delegate = NULL; 106 delegate = NULL;
107 107
108 // Add the tab back in. 108 // Add the tab back in.
109 browser::Navigate(&params); 109 chrome::Navigate(&params);
110 } 110 }
111 111
112 void InstantUnloadHandler::Destroy(WebContentsDelegateImpl* delegate) { 112 void InstantUnloadHandler::Destroy(WebContentsDelegateImpl* delegate) {
113 ScopedVector<WebContentsDelegateImpl>::iterator i = 113 ScopedVector<WebContentsDelegateImpl>::iterator i =
114 std::find(delegates_.begin(), delegates_.end(), delegate); 114 std::find(delegates_.begin(), delegates_.end(), delegate);
115 DCHECK(i != delegates_.end()); 115 DCHECK(i != delegates_.end());
116 delegates_.erase(i); 116 delegates_.erase(i);
117 } 117 }
OLDNEW
« no previous file with comments | « chrome/browser/history/android/visit_sql_handler.cc ('k') | chrome/browser/platform_util_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698