diff options
| author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-13 17:48:38 +0000 |
|---|---|---|
| committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-13 17:48:38 +0000 |
| commit | 57f46172dab50be76f17c48f023dcbf20b6d6620 (patch) | |
| tree | e7626ef5991e26cb969e676db2c88b7ea3e1e1d0 | |
| parent | adc7bbb7b773a94881287323ba1edc9d35dbf7f9 (diff) | |
| download | chromium_src-57f46172dab50be76f17c48f023dcbf20b6d6620.zip chromium_src-57f46172dab50be76f17c48f023dcbf20b6d6620.tar.gz chromium_src-57f46172dab50be76f17c48f023dcbf20b6d6620.tar.bz2 | |
Misc. tiny cleanups
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10544131
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141911 0039d316-1c4b-4281-b951-d872f2087c98
| -rw-r--r-- | chrome/browser/autocomplete/extension_app_provider.cc | 25 | ||||
| -rw-r--r-- | chrome/browser/autocomplete/extension_app_provider.h | 3 | ||||
| -rw-r--r-- | chrome/browser/autocomplete/keyword_provider.cc | 3 | ||||
| -rw-r--r-- | chrome/browser/autocomplete/keyword_provider.h | 3 | ||||
| -rw-r--r-- | chrome/browser/ui/browser.cc | 3 |
5 files changed, 14 insertions, 23 deletions
diff --git a/chrome/browser/autocomplete/extension_app_provider.cc b/chrome/browser/autocomplete/extension_app_provider.cc index b538469..6d38b2d8 100644 --- a/chrome/browser/autocomplete/extension_app_provider.cc +++ b/chrome/browser/autocomplete/extension_app_provider.cc @@ -10,6 +10,7 @@ #include "base/string16.h" #include "base/utf_string_conversions.h" #include "chrome/browser/extensions/extension_service.h" +#include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/history/history.h" #include "chrome/browser/history/url_database.h" #include "chrome/browser/profiles/profile.h" @@ -23,7 +24,13 @@ ExtensionAppProvider::ExtensionAppProvider(ACProviderListener* listener, Profile* profile) : AutocompleteProvider(listener, profile, "ExtensionApps") { - RegisterForNotifications(); + // Notifications of extensions loading and unloading always come from the + // non-incognito profile, but we need to see them regardless, as the incognito + // windows can be affected. + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, + content::Source<Profile>(profile_->GetOriginalProfile())); + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, + content::Source<Profile>(profile_->GetOriginalProfile())); RefreshAppList(); } @@ -32,7 +39,8 @@ void ExtensionAppProvider::LaunchAppFromOmnibox( const AutocompleteMatch& match, Profile* profile, WindowOpenDisposition disposition) { - ExtensionService* service = profile->GetExtensionService(); + ExtensionService* service = + ExtensionSystemFactory::GetForProfile(profile)->extension_service(); const extensions::Extension* extension = service->GetInstalledApp(match.destination_url); // While the Omnibox popup is open, the extension can be updated, changing @@ -138,7 +146,8 @@ ExtensionAppProvider::~ExtensionAppProvider() { } void ExtensionAppProvider::RefreshAppList() { - ExtensionService* extension_service = profile_->GetExtensionService(); + ExtensionService* extension_service = + ExtensionSystemFactory::GetForProfile(profile_)->extension_service(); if (!extension_service) return; // During testing, there is no extension service. const ExtensionSet* extensions = extension_service->extensions(); @@ -169,16 +178,6 @@ void ExtensionAppProvider::RefreshAppList() { } } -void ExtensionAppProvider::RegisterForNotifications() { - // Notifications of extensions loading and unloading always come from the - // non-incognito profile, but we need to see them regardless, as the incognito - // windows can be affected. - registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, - content::Source<Profile>(profile_->GetOriginalProfile())); - registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, - content::Source<Profile>(profile_->GetOriginalProfile())); -} - void ExtensionAppProvider::Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) { diff --git a/chrome/browser/autocomplete/extension_app_provider.h b/chrome/browser/autocomplete/extension_app_provider.h index 3978730..93d667b 100644 --- a/chrome/browser/autocomplete/extension_app_provider.h +++ b/chrome/browser/autocomplete/extension_app_provider.h @@ -76,9 +76,6 @@ class ExtensionAppProvider : public AutocompleteProvider, // Fetch the current app list and cache it locally. void RefreshAppList(); - // Register for install/uninstall notification so we can update our cache. - void RegisterForNotifications(); - // Calculate the relevance of the match. int CalculateRelevance(AutocompleteInput::Type type, int input_length, diff --git a/chrome/browser/autocomplete/keyword_provider.cc b/chrome/browser/autocomplete/keyword_provider.cc index ba2028b..fdd5489 100644 --- a/chrome/browser/autocomplete/keyword_provider.cc +++ b/chrome/browser/autocomplete/keyword_provider.cc @@ -361,7 +361,6 @@ bool KeywordProvider::ExtractKeywordFromInput(const AutocompleteInput& input, // static void KeywordProvider::FillInURLAndContents( - Profile* profile, const string16& remaining_input, const TemplateURL* element, AutocompleteMatch* match) { @@ -470,7 +469,7 @@ AutocompleteMatch KeywordProvider::CreateAutocompleteMatch( // Create destination URL and popup entry content by substituting user input // into keyword templates. - FillInURLAndContents(profile_, remaining_input, element, &match); + FillInURLAndContents(remaining_input, element, &match); match.keyword = keyword; match.transition = content::PAGE_TRANSITION_KEYWORD; diff --git a/chrome/browser/autocomplete/keyword_provider.h b/chrome/browser/autocomplete/keyword_provider.h index 7f395c6..14a3b5a 100644 --- a/chrome/browser/autocomplete/keyword_provider.h +++ b/chrome/browser/autocomplete/keyword_provider.h @@ -113,8 +113,7 @@ class KeywordProvider : public AutocompleteProvider, // Fills in the "destination_url" and "contents" fields of |match| with the // provided user input and keyword data. - static void FillInURLAndContents(Profile* profile, - const string16& remaining_input, + static void FillInURLAndContents(const string16& remaining_input, const TemplateURL* element, AutocompleteMatch* match); diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 280a418..abc12dd 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -69,9 +69,6 @@ #include "chrome/browser/platform_util.h" #include "chrome/browser/prefs/incognito_mode_prefs.h" #include "chrome/browser/prefs/pref_service.h" -#include "chrome/browser/prerender/prerender_manager.h" -#include "chrome/browser/prerender/prerender_manager_factory.h" -#include "chrome/browser/prerender/prerender_tab_helper.h" #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" #include "chrome/browser/printing/print_preview_tab_controller.h" #include "chrome/browser/printing/print_view_manager.h" |
