Home | History | Annotate | Download | only in search

Lines Matching full:profile

16 #include "chrome/browser/profiles/profile.h"
119 TemplateURL* GetDefaultSearchProviderTemplateURL(Profile* profile) {
121 TemplateURLServiceFactory::GetForProfile(profile);
160 // |profile|.
162 Profile* profile) {
169 InstantServiceFactory::GetForProfile(profile);
189 // Returns true if |url| can be used as an Instant URL for |profile|.
190 bool IsInstantURL(const GURL& url, Profile* profile) {
197 const GURL new_tab_url(GetNewTabPageURL(profile));
202 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
234 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
236 if (!IsRenderedInInstantProcess(contents, profile) &&
238 !ShouldAssignURLToInstantRenderer(entry->GetURL(), profile)))
247 return GetSearchTermsFromURL(profile, entry->GetVirtualURL());
250 bool IsURLAllowedForSupervisedUser(const GURL& url, Profile* profile) {
253 ManagedUserServiceFactory::GetForProfile(profile);
306 base::string16 GetSearchTermsFromURL(Profile* profile, const GURL& url) {
307 if (url.is_valid() && url == GetSearchResultPrefetchBaseURL(profile)) {
311 InstantSearchPrerenderer::GetForProfile(profile);
317 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
351 bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile) {
353 profile &&
356 IsInstantURL(url, profile));
359 bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile) {
360 return ShouldAssignURLToInstantRenderer(url, profile) &&
365 bool IsNTPURL(const GURL& url, Profile* profile) {
372 return profile &&
373 ((IsInstantURL(url, profile) &&
374 GetSearchTermsFromURL(profile, url).empty()) ||
391 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
392 if (!IsRenderedInInstantProcess(contents, profile))
395 if (entry->GetURL() == GetLocalInstantURL(profile))
399 GURL new_tab_url(GetNewTabPageURL(profile));
404 return IsInstantURL(entry->GetVirtualURL(), profile) &&
408 bool IsSuggestPrefEnabled(Profile* profile) {
409 return profile && !profile->IsOffTheRecord() && profile->GetPrefs() &&
410 profile->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled);
413 GURL GetInstantURL(Profile* profile, int start_margin,
415 if (!IsInstantExtendedAPIEnabled() || !IsSuggestPrefEnabled(profile))
418 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
440 if (!IsURLAllowedForSupervisedUser(instant_url, profile))
446 // Returns URLs associated with the default search engine for |profile|.
447 std::vector<GURL> GetSearchURLs(Profile* profile) {
449 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
460 GURL GetNewTabPageURL(Profile* profile) {
464 if (!profile || profile->IsOffTheRecord())
467 if (!IsSuggestPrefEnabled(profile))
470 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
479 if (!IsURLAllowedForSupervisedUser(url, profile))
485 GURL GetSearchResultPrefetchBaseURL(Profile* profile) {
487 GetInstantURL(profile, kDisableStartMargin, true) : GURL();
499 GURL GetLocalInstantURL(Profile* profile) {
561 GURL GetEffectiveURLForInstant(const GURL& url, Profile* profile) {
562 CHECK(ShouldAssignURLToInstantRenderer(url, profile))
579 TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile);
619 return false; // The profile manager can be NULL while testing.
621 const std::vector<Profile*>& profiles = profile_manager->GetLoadedProfiles();
640 Profile* profile = Profile::FromBrowserContext(browser_context);
641 GURL new_tab_url(GetNewTabPageURL(profile));
654 Profile* profile = Profile::FromBrowserContext(browser_context);
655 GURL new_tab_url(GetNewTabPageURL(profile));