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

Side by Side Diff: chrome/browser/history/history_tab_helper.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
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/history/history_tab_helper.h" 5 #include "chrome/browser/history/history_tab_helper.h"
6 6
7 #include "chrome/browser/history/history.h" 7 #include "chrome/browser/history/history.h"
8 #include "chrome/browser/history/top_sites.h" 8 #include "chrome/browser/history/top_sites.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 scoped_refptr<history::HistoryAddPageArgs> 42 scoped_refptr<history::HistoryAddPageArgs>
43 HistoryTabHelper::CreateHistoryAddPageArgs( 43 HistoryTabHelper::CreateHistoryAddPageArgs(
44 const GURL& virtual_url, 44 const GURL& virtual_url,
45 const content::LoadCommittedDetails& details, 45 const content::LoadCommittedDetails& details,
46 const ViewHostMsg_FrameNavigate_Params& params) { 46 const ViewHostMsg_FrameNavigate_Params& params) {
47 scoped_refptr<history::HistoryAddPageArgs> add_page_args( 47 scoped_refptr<history::HistoryAddPageArgs> add_page_args(
48 new history::HistoryAddPageArgs( 48 new history::HistoryAddPageArgs(
49 params.url, base::Time::Now(), tab_contents(), params.page_id, 49 params.url, base::Time::Now(), tab_contents(), params.page_id,
50 params.referrer, params.redirects, params.transition, 50 params.referrer, params.redirects, params.transition,
51 history::SOURCE_BROWSED, details.did_replace_entry)); 51 history::SOURCE_BROWSED, details.did_replace_entry));
52 if (PageTransition::IsMainFrame(params.transition) && 52 if (content::PageTransitionIsMainFrame(params.transition) &&
53 virtual_url != params.url) { 53 virtual_url != params.url) {
54 // Hack on the "virtual" URL so that it will appear in history. For some 54 // Hack on the "virtual" URL so that it will appear in history. For some
55 // types of URLs, we will display a magic URL that is different from where 55 // types of URLs, we will display a magic URL that is different from where
56 // the page is actually navigated. We want the user to see in history what 56 // the page is actually navigated. We want the user to see in history what
57 // they saw in the URL bar, so we add the virtual URL as a redirect. This 57 // they saw in the URL bar, so we add the virtual URL as a redirect. This
58 // only applies to the main frame, as the virtual URL doesn't apply to 58 // only applies to the main frame, as the virtual URL doesn't apply to
59 // sub-frames. 59 // sub-frames.
60 add_page_args->url = virtual_url; 60 add_page_args->url = virtual_url;
61 if (!add_page_args->redirects.empty()) 61 if (!add_page_args->redirects.empty())
62 add_page_args->redirects.back() = virtual_url; 62 add_page_args->redirects.back() = virtual_url;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 HistoryService* HistoryTabHelper::GetHistoryService() { 159 HistoryService* HistoryTabHelper::GetHistoryService() {
160 Profile* profile = 160 Profile* profile =
161 Profile::FromBrowserContext(tab_contents()->browser_context()); 161 Profile::FromBrowserContext(tab_contents()->browser_context());
162 if (profile->IsOffTheRecord()) 162 if (profile->IsOffTheRecord())
163 return NULL; 163 return NULL;
164 164
165 return profile->GetHistoryService(Profile::IMPLICIT_ACCESS); 165 return profile->GetHistoryService(Profile::IMPLICIT_ACCESS);
166 } 166 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_querying_unittest.cc ('k') | chrome/browser/history/history_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698