Home | History | Annotate | Download | only in search

Lines Matching full:profile

15 #include "chrome/browser/profiles/profile.h"
111 // Corrupt state (e.g. no profile or template url).
161 TemplateURL* GetDefaultSearchProviderTemplateURL(Profile* profile) {
162 if (profile) {
164 TemplateURLServiceFactory::GetForProfile(profile);
218 // Returns true if |url| can be used as an Instant URL for |profile|.
219 bool IsInstantURL(const GURL& url, Profile* profile) {
226 const GURL new_tab_url(GetNewTabPageURL(profile));
231 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
239 UIThreadSearchTermsData search_terms_data(profile);
263 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
265 !IsRenderedInInstantProcess(contents, profile) &&
267 !ShouldAssignURLToInstantRenderer(entry->GetURL(), profile)))
275 if (!IsQueryExtractionAllowedForURL(profile, entry->GetVirtualURL()))
279 return ExtractSearchTermsFromURL(profile, entry->GetVirtualURL());
282 bool IsURLAllowedForSupervisedUser(const GURL& url, Profile* profile) {
285 SupervisedUserServiceFactory::GetForProfile(profile);
298 NewTabURLState IsValidNewTabURL(Profile* profile, const GURL& new_tab_url) {
299 if (profile->IsOffTheRecord())
305 if (!IsURLAllowedForSupervisedUser(new_tab_url, profile))
316 static NewTabURLDetails ForProfile(Profile* profile) {
318 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
319 if (!profile || !template_url)
323 template_url->new_tab_url_ref(), UIThreadSearchTermsData(profile),
325 NewTabURLState state = IsValidNewTabURL(profile, search_provider_url);
406 base::string16 ExtractSearchTermsFromURL(Profile* profile, const GURL& url) {
407 if (url.is_valid() && url == GetSearchResultPrefetchBaseURL(profile)) {
411 InstantSearchPrerenderer::GetForProfile(profile);
418 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
422 url, UIThreadSearchTermsData(profile), &search_terms);
426 bool IsQueryExtractionAllowedForURL(Profile* profile
427 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
458 bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile) {
460 profile &&
463 IsInstantURL(url, profile));
467 Profile* profile) {
474 InstantServiceFactory::GetForProfile(profile);
481 bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile) {
482 return ShouldAssignURLToInstantRenderer(url, profile) &&
487 bool IsNTPURL(const GURL& url, Profile* profile) {
494 const base::string16 search_terms = ExtractSearchTermsFromURL(profile, url);
495 return profile &&
496 ((IsInstantURL(url, profile) && search_terms.empty()) ||
513 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
514 if (!IsRenderedInInstantProcess(contents, profile))
517 if (entry->GetURL() == GetLocalInstantURL(profile))
520 GURL new_tab_url(GetNewTabPageURL(profile));
525 bool IsSuggestPrefEnabled(Profile* profile) {
526 return profile && !profile->IsOffTheRecord() && profile->GetPrefs() &&
527 profile->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled);
530 GURL GetInstantURL(Profile* profile, int start_margin,
532 if (!IsInstantExtendedAPIEnabled() || !IsSuggestPrefEnabled(profile))
535 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
540 template_url->instant_url_ref(), UIThreadSearchTermsData(profile),
557 if (!IsURLAllowedForSupervisedUser(instant_url, profile))
572 // Returns URLs associated with the default search engine for |profile|.
573 std::vector<GURL> GetSearchURLs(Profile* profile) {
575 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
580 result.push_back(TemplateURLRefToGURL(ref, UIThreadSearchTermsData(profile),
586 GURL GetNewTabPageURL(Profile* profile) {
587 return NewTabURLDetails::ForProfile(profile).url;
590 GURL GetSearchResultPrefetchBaseURL(Profile* profile) {
592 GetInstantURL(profile, kDisableStartMargin, true) : GURL();
636 GURL GetLocalInstantURL(Profile* profile) {
695 GURL GetEffectiveURLForInstant(const GURL& url, Profile* profile) {
696 CHECK(ShouldAssignURLToInstantRenderer(url, profile))
713 NewTabURLDetails details = NewTabURLDetails::ForProfile(profile);
733 Profile* profile = Profile::FromBrowserContext(browser_context);
734 NewTabURLDetails details(NewTabURLDetails::ForProfile(profile));
750 Profile* profile = Profile::FromBrowserContext(browser_context);
751 if (profile && profile->IsOffTheRecord())
760 GURL new_tab_url(GetNewTabPageURL(profile));