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

Side by Side Diff: chrome/browser/tabs/tab_finder.cc

Issue 8253002: Move PageTransition into content namespace. While I'm touching all these files, I've also updated... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « chrome/browser/tabs/pinned_tab_codec.cc ('k') | chrome/browser/tabs/tab_strip_model.h » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/tabs/tab_finder.h" 5 #include "chrome/browser/tabs/tab_finder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "chrome/browser/history/history.h" 11 #include "chrome/browser/history/history.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_list.h" 14 #include "chrome/browser/ui/browser_list.h"
15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
16 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
17 #include "content/browser/tab_contents/navigation_details.h" 17 #include "content/browser/tab_contents/navigation_details.h"
18 #include "content/browser/tab_contents/navigation_entry.h" 18 #include "content/browser/tab_contents/navigation_entry.h"
19 #include "content/browser/tab_contents/tab_contents.h" 19 #include "content/browser/tab_contents/tab_contents.h"
20 #include "content/browser/tab_contents/tab_contents_observer.h" 20 #include "content/browser/tab_contents/tab_contents_observer.h"
21 #include "content/common/content_notification_types.h" 21 #include "content/common/content_notification_types.h"
22 #include "content/common/notification_service.h" 22 #include "content/common/notification_service.h"
23 #include "content/common/notification_source.h" 23 #include "content/common/notification_source.h"
24 #include "content/common/page_transition_types.h"
25 #include "content/common/view_messages.h" 24 #include "content/common/view_messages.h"
25 #include "content/public/common/page_transition_types.h"
26 26
27 class TabFinder::TabContentsObserverImpl : public TabContentsObserver { 27 class TabFinder::TabContentsObserverImpl : public TabContentsObserver {
28 public: 28 public:
29 TabContentsObserverImpl(TabContents* tab, TabFinder* finder); 29 TabContentsObserverImpl(TabContents* tab, TabFinder* finder);
30 virtual ~TabContentsObserverImpl(); 30 virtual ~TabContentsObserverImpl();
31 31
32 TabContents* tab_contents() { return TabContentsObserver::tab_contents(); } 32 TabContents* tab_contents() { return TabContentsObserver::tab_contents(); }
33 33
34 // TabContentsObserver overrides: 34 // TabContentsObserver overrides:
35 virtual void DidNavigateAnyFramePostCommit( 35 virtual void DidNavigateAnyFramePostCommit(
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 TabFinder::~TabFinder() { 129 TabFinder::~TabFinder() {
130 STLDeleteElements(&tab_contents_observers_); 130 STLDeleteElements(&tab_contents_observers_);
131 } 131 }
132 132
133 void TabFinder::DidNavigateAnyFramePostCommit( 133 void TabFinder::DidNavigateAnyFramePostCommit(
134 TabContents* source, 134 TabContents* source,
135 const content::LoadCommittedDetails& details, 135 const content::LoadCommittedDetails& details,
136 const ViewHostMsg_FrameNavigate_Params& params) { 136 const ViewHostMsg_FrameNavigate_Params& params) {
137 CancelRequestsFor(source); 137 CancelRequestsFor(source);
138 138
139 if (PageTransition::IsRedirect(params.transition)) { 139 if (content::PageTransitionIsRedirect(params.transition)) {
140 // If this is a redirect, we need to go to the db to get the start. 140 // If this is a redirect, we need to go to the db to get the start.
141 FetchRedirectStart(source); 141 FetchRedirectStart(source);
142 } else if (params.redirects.size() > 1 || 142 } else if (params.redirects.size() > 1 ||
143 params.redirects[0] != details.entry->url()) { 143 params.redirects[0] != details.entry->url()) {
144 tab_contents_to_url_[source] = params.redirects[0]; 144 tab_contents_to_url_[source] = params.redirects[0];
145 } 145 }
146 } 146 }
147 147
148 bool TabFinder::TabMatchesURL(TabContents* tab_contents, const GURL& url) { 148 bool TabFinder::TabMatchesURL(TabContents* tab_contents, const GURL& url) {
149 if (tab_contents->GetURL() == url) 149 if (tab_contents->GetURL() == url)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 GURL url, 228 GURL url,
229 bool success, 229 bool success,
230 history::RedirectList* redirects) { 230 history::RedirectList* redirects) {
231 if (success && !redirects->empty()) { 231 if (success && !redirects->empty()) {
232 TabContents* tab_contents = 232 TabContents* tab_contents =
233 callback_consumer_.GetClientDataForCurrentRequest(); 233 callback_consumer_.GetClientDataForCurrentRequest();
234 DCHECK(tab_contents); 234 DCHECK(tab_contents);
235 tab_contents_to_url_[tab_contents] = redirects->back(); 235 tab_contents_to_url_[tab_contents] = redirects->back();
236 } 236 }
237 } 237 }
OLDNEW
« no previous file with comments | « chrome/browser/tabs/pinned_tab_codec.cc ('k') | chrome/browser/tabs/tab_strip_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698