diff options
author | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-13 21:19:14 +0000 |
---|---|---|
committer | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-13 21:19:14 +0000 |
commit | 6600f2ac013fa7e4ab610a16d76407092e1fb9b1 (patch) | |
tree | 996bab74d49362243a37e7ad80c247a5c41df0ec | |
parent | 0df33079424e191c9a1e77e5fbd2d2d94c634d53 (diff) | |
download | chromium_src-6600f2ac013fa7e4ab610a16d76407092e1fb9b1.zip chromium_src-6600f2ac013fa7e4ab610a16d76407092e1fb9b1.tar.gz chromium_src-6600f2ac013fa7e4ab610a16d76407092e1fb9b1.tar.bz2 |
Make HistoryAPI a PKS
Move HistoryExtensionAPI to c/b/e/api/history; rename to HistoryAPI.
Make a PKS for History, and make HistoryEventRouter initialized lazily when a history listener registers.
BUG=159265,101244
Review URL: https://chromiumcodereview.appspot.com/11419195
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172958 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/api/history/history_api.cc (renamed from chrome/browser/history/history_extension_api.cc) | 69 | ||||
-rw-r--r-- | chrome/browser/extensions/api/history/history_api.h (renamed from chrome/browser/history/history_extension_api.h) | 38 | ||||
-rw-r--r-- | chrome/browser/extensions/api/history/history_api_factory.cc | 47 | ||||
-rw-r--r-- | chrome/browser/extensions/api/history/history_api_factory.h | 36 | ||||
-rw-r--r-- | chrome/browser/extensions/api/history/history_apitest.cc (renamed from chrome/browser/history/history_extension_apitest.cc) | 20 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_function_registry.cc | 16 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_service.cc | 2 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_service.h | 3 | ||||
-rw-r--r-- | chrome/browser/history/DEPS | 2 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_dependency_manager.cc | 2 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 2 | ||||
-rw-r--r-- | chrome/chrome_browser_extensions.gypi | 4 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 2 |
13 files changed, 186 insertions, 57 deletions
diff --git a/chrome/browser/history/history_extension_api.cc b/chrome/browser/extensions/api/history/history_api.cc index a3a129c..00af52c 100644 --- a/chrome/browser/history/history_extension_api.cc +++ b/chrome/browser/extensions/api/history/history_api.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/history/history_extension_api.h" +#include "chrome/browser/extensions/api/history/history_api.h" #include "base/bind.h" #include "base/bind_helpers.h" @@ -27,24 +27,25 @@ #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" -using extensions::api::experimental_history::MostVisitedItem; -using extensions::api::history::HistoryItem; -using extensions::api::history::VisitItem; +namespace extensions { -typedef std::vector<linked_ptr<extensions::api::history::HistoryItem> > +using api::experimental_history::MostVisitedItem; +using api::history::HistoryItem; +using api::history::VisitItem; + +typedef std::vector<linked_ptr<api::history::HistoryItem> > HistoryItemList; -typedef std::vector<linked_ptr<extensions::api::history::VisitItem> > +typedef std::vector<linked_ptr<api::history::VisitItem> > VisitItemList; -namespace AddUrl = extensions::api::history::AddUrl; -namespace DeleteUrl = extensions::api::history::DeleteUrl; -namespace DeleteRange = extensions::api::history::DeleteRange; -namespace GetMostVisited = - extensions::api::experimental_history::GetMostVisited; -namespace GetVisits = extensions::api::history::GetVisits; -namespace OnVisited = extensions::api::history::OnVisited; -namespace OnVisitRemoved = extensions::api::history::OnVisitRemoved; -namespace Search = extensions::api::history::Search; +namespace AddUrl = api::history::AddUrl; +namespace DeleteUrl = api::history::DeleteUrl; +namespace DeleteRange = api::history::DeleteRange; +namespace GetMostVisited = api::experimental_history::GetMostVisited; +namespace GetVisits = api::history::GetVisits; +namespace OnVisited = api::history::OnVisited; +namespace OnVisitRemoved = api::history::OnVisitRemoved; +namespace Search = api::history::Search; namespace { @@ -127,7 +128,7 @@ scoped_ptr<VisitItem> GetVisitItem(const history::VisitRow& row) { } // namespace -HistoryExtensionEventRouter::HistoryExtensionEventRouter(Profile* profile) { +HistoryEventRouter::HistoryEventRouter(Profile* profile) { const content::Source<Profile> source = content::Source<Profile>(profile); registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URL_VISITED, @@ -137,12 +138,11 @@ HistoryExtensionEventRouter::HistoryExtensionEventRouter(Profile* profile) { source); } -HistoryExtensionEventRouter::~HistoryExtensionEventRouter() {} +HistoryEventRouter::~HistoryEventRouter() {} -void HistoryExtensionEventRouter::Observe( - int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) { +void HistoryEventRouter::Observe(int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { switch (type) { case chrome::NOTIFICATION_HISTORY_URL_VISITED: HistoryUrlVisited( @@ -159,7 +159,7 @@ void HistoryExtensionEventRouter::Observe( } } -void HistoryExtensionEventRouter::HistoryUrlVisited( +void HistoryEventRouter::HistoryUrlVisited( Profile* profile, const history::URLVisitedDetails* details) { scoped_ptr<HistoryItem> history_item = GetHistoryItem(details->row); @@ -168,7 +168,7 @@ void HistoryExtensionEventRouter::HistoryUrlVisited( DispatchEvent(profile, kOnVisited, args.Pass()); } -void HistoryExtensionEventRouter::HistoryUrlsRemoved( +void HistoryEventRouter::HistoryUrlsRemoved( Profile* profile, const history::URLsDeletedDetails* details) { OnVisitRemoved::Removed removed; @@ -185,7 +185,7 @@ void HistoryExtensionEventRouter::HistoryUrlsRemoved( DispatchEvent(profile, kOnVisitRemoved, args.Pass()); } -void HistoryExtensionEventRouter::DispatchEvent( +void HistoryEventRouter::DispatchEvent( Profile* profile, const char* event_name, scoped_ptr<ListValue> event_args) { @@ -198,6 +198,25 @@ void HistoryExtensionEventRouter::DispatchEvent( } } +HistoryAPI::HistoryAPI(Profile* profile) : profile_(profile) { + ExtensionSystem::Get(profile_)->event_router()->RegisterObserver( + this, kOnVisited); + ExtensionSystem::Get(profile_)->event_router()->RegisterObserver( + this, kOnVisitRemoved); +} + +HistoryAPI::~HistoryAPI() { +} + +void HistoryAPI::Shutdown() { + ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); +} + +void HistoryAPI::OnListenerAdded(const EventListenerInfo& details) { + history_event_router_.reset(new HistoryEventRouter(profile_)); + ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); +} + void HistoryFunction::Run() { if (!RunImpl()) { SendResponse(false); @@ -451,3 +470,5 @@ bool DeleteAllHistoryFunction::RunAsyncImpl() { void DeleteAllHistoryFunction::DeleteComplete() { SendAsyncResponse(); } + +} // namespace extensions diff --git a/chrome/browser/history/history_extension_api.h b/chrome/browser/extensions/api/history/history_api.h index c9de515..83860eb 100644 --- a/chrome/browser/history/history_extension_api.h +++ b/chrome/browser/extensions/api/history/history_api.h @@ -2,17 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_HISTORY_HISTORY_EXTENSION_API_H_ -#define CHROME_BROWSER_HISTORY_HISTORY_EXTENSION_API_H_ +#ifndef CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ +#define CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ #include <string> #include <vector> #include "base/compiler_specific.h" #include "base/memory/linked_ptr.h" +#include "chrome/browser/extensions/event_router.h" #include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/history/history.h" #include "chrome/browser/history/history_notifications.h" +#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/cancelable_task_tracker.h" #include "chrome/common/extensions/api/history.h" #include "content/public/browser/notification_registrar.h" @@ -21,12 +23,14 @@ namespace base { class ListValue; } +namespace extensions { + // Observes History service and routes the notifications as events to the // extension system. -class HistoryExtensionEventRouter : public content::NotificationObserver { +class HistoryEventRouter : public content::NotificationObserver { public: - explicit HistoryExtensionEventRouter(Profile* profile); - virtual ~HistoryExtensionEventRouter(); + explicit HistoryEventRouter(Profile* profile); + virtual ~HistoryEventRouter(); private: // content::NotificationObserver::Observe. @@ -47,9 +51,27 @@ class HistoryExtensionEventRouter : public content::NotificationObserver { // Used for tracking registrations to history service notifications. content::NotificationRegistrar registrar_; - DISALLOW_COPY_AND_ASSIGN(HistoryExtensionEventRouter); + DISALLOW_COPY_AND_ASSIGN(HistoryEventRouter); }; +class HistoryAPI : public ProfileKeyedService, + public EventRouter::Observer { + public: + explicit HistoryAPI(Profile* profile); + virtual ~HistoryAPI(); + + // ProfileKeyedService implementation. + virtual void Shutdown() OVERRIDE; + + // EventRouter::Observer implementation. + virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; + + private: + Profile* profile_; + + // Created lazily upon OnListenerAdded. + scoped_ptr<HistoryEventRouter> history_event_router_; +}; // Base class for history function APIs. class HistoryFunction : public AsyncExtensionFunction { @@ -188,4 +210,6 @@ class DeleteRangeHistoryFunction : public HistoryFunctionWithCallback { void DeleteComplete(); }; -#endif // CHROME_BROWSER_HISTORY_HISTORY_EXTENSION_API_H_ +} // namespace extensions + +#endif // CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ diff --git a/chrome/browser/extensions/api/history/history_api_factory.cc b/chrome/browser/extensions/api/history/history_api_factory.cc new file mode 100644 index 0000000..2a80ff4 --- /dev/null +++ b/chrome/browser/extensions/api/history/history_api_factory.cc @@ -0,0 +1,47 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/extensions/api/history/history_api_factory.h" + +#include "chrome/browser/extensions/api/history/history_api.h" +#include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile_dependency_manager.h" + +namespace extensions { + +// static +HistoryAPI* HistoryAPIFactory::GetForProfile( + Profile* profile) { + return static_cast<HistoryAPI*>( + GetInstance()->GetServiceForProfile(profile, true)); +} + +// static +HistoryAPIFactory* HistoryAPIFactory::GetInstance() { + return Singleton<HistoryAPIFactory>::get(); +} + +HistoryAPIFactory::HistoryAPIFactory() + : ProfileKeyedServiceFactory("HistoryAPI", + ProfileDependencyManager::GetInstance()) { + DependsOn(ExtensionSystemFactory::GetInstance()); +} + +HistoryAPIFactory::~HistoryAPIFactory() { +} + +ProfileKeyedService* HistoryAPIFactory::BuildServiceInstanceFor( + Profile* profile) const { + return new HistoryAPI(profile); +} + +bool HistoryAPIFactory::ServiceIsCreatedWithProfile() const { + return true; +} + +bool HistoryAPIFactory::ServiceIsNULLWhileTesting() const { + return true; +} + +} // namespace extensions diff --git a/chrome/browser/extensions/api/history/history_api_factory.h b/chrome/browser/extensions/api/history/history_api_factory.h new file mode 100644 index 0000000..671ea72 --- /dev/null +++ b/chrome/browser/extensions/api/history/history_api_factory.h @@ -0,0 +1,36 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_FACTORY_H_ +#define CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_FACTORY_H_ + +#include "base/memory/singleton.h" +#include "chrome/browser/profiles/profile_keyed_service_factory.h" + +namespace extensions { + +class HistoryAPI; + +class HistoryAPIFactory : public ProfileKeyedServiceFactory { + public: + static HistoryAPI* GetForProfile(Profile* profile); + + static HistoryAPIFactory* GetInstance(); + + private: + friend struct DefaultSingletonTraits<HistoryAPIFactory>; + + HistoryAPIFactory(); + virtual ~HistoryAPIFactory(); + + // ProfileKeyedBaseFactory implementation. + virtual ProfileKeyedService* BuildServiceInstanceFor( + Profile* profile) const OVERRIDE; + virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; + virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; +}; + +} // namespace extensions + +#endif // CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_FACTORY_H_ diff --git a/chrome/browser/history/history_extension_apitest.cc b/chrome/browser/extensions/api/history/history_apitest.cc index 1eec1c4..b99cb32 100644 --- a/chrome/browser/history/history_extension_apitest.cc +++ b/chrome/browser/extensions/api/history/history_apitest.cc @@ -6,16 +6,18 @@ #include "base/command_line.h" #include "base/utf_string_conversions.h" #include "chrome/browser/extensions/extension_apitest.h" +#include "chrome/browser/history/history.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/history/history_types.h" -#include "chrome/browser/history/history.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/common/chrome_switches.h" #include "googleurl/src/gurl.h" #include "net/base/mock_host_resolver.h" -class HistoryExtensionApiTest : public ExtensionApiTest { +namespace extensions { + +class HistoryApiTest : public ExtensionApiTest { public: virtual void SetUpInProcessBrowserTestFixture() { ExtensionApiTest::SetUpInProcessBrowserTestFixture(); @@ -33,12 +35,12 @@ class HistoryExtensionApiTest : public ExtensionApiTest { }; // Full text search indexing sometimes exceeds a timeout. (http://crbug/119505) -IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, DISABLED_MiscSearch) { +IN_PROC_BROWSER_TEST_F(HistoryApiTest, DISABLED_MiscSearch) { ASSERT_TRUE(RunExtensionSubtest("history", "misc_search.html")) << message_; } // Same could happen here without the FTS (http://crbug/119505) -IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, DISABLED_TimedSearch) { +IN_PROC_BROWSER_TEST_F(HistoryApiTest, DISABLED_TimedSearch) { ASSERT_TRUE(RunExtensionSubtest("history", "timed_search.html")) << message_; } @@ -48,12 +50,12 @@ IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, DISABLED_TimedSearch) { #else #define MAYBE_Delete Delete #endif -IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, MAYBE_Delete) { +IN_PROC_BROWSER_TEST_F(HistoryApiTest, MAYBE_Delete) { ASSERT_TRUE(RunExtensionSubtest("history", "delete.html")) << message_; } // See crbug.com/79074 -IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, DISABLED_GetVisits) { +IN_PROC_BROWSER_TEST_F(HistoryApiTest, DISABLED_GetVisits) { ASSERT_TRUE(RunExtensionSubtest("history", "get_visits.html")) << message_; } @@ -65,12 +67,12 @@ IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, DISABLED_GetVisits) { #define MAYBE_SearchAfterAdd SearchAfterAdd #endif -IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, MAYBE_SearchAfterAdd) { +IN_PROC_BROWSER_TEST_F(HistoryApiTest, MAYBE_SearchAfterAdd) { ASSERT_TRUE(RunExtensionSubtest("history", "search_after_add.html")) << message_; } -IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, MostVisited) { +IN_PROC_BROWSER_TEST_F(HistoryApiTest, MostVisited) { // Add entries to the history database that we can query for (using the // extension history API for this doesn't work as it only adds URLs with // LINK transition type). @@ -98,3 +100,5 @@ IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, MostVisited) { ASSERT_TRUE(RunExtensionSubtest("history", "most_visited.html")) << message_; } + +} // namespace extensions diff --git a/chrome/browser/extensions/extension_function_registry.cc b/chrome/browser/extensions/extension_function_registry.cc index 840f2e6..ca1916d 100644 --- a/chrome/browser/extensions/extension_function_registry.cc +++ b/chrome/browser/extensions/extension_function_registry.cc @@ -20,6 +20,7 @@ #include "chrome/browser/extensions/api/extension_action/extension_page_actions_api.h" #include "chrome/browser/extensions/api/extension_action/extension_script_badge_api.h" #include "chrome/browser/extensions/api/font_settings/font_settings_api.h" +#include "chrome/browser/extensions/api/history/history_api.h" #include "chrome/browser/extensions/api/identity/identity_api.h" #include "chrome/browser/extensions/api/i18n/i18n_api.h" #include "chrome/browser/extensions/api/idle/idle_api.h" @@ -44,7 +45,6 @@ #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" #include "chrome/browser/extensions/settings/settings_api.h" #include "chrome/browser/extensions/system/system_api.h" -#include "chrome/browser/history/history_extension_api.h" #include "chrome/browser/history/top_sites_extension_api.h" #include "chrome/browser/infobars/infobar_extension_api.h" #include "chrome/browser/rlz/rlz_extension_api.h" @@ -190,13 +190,13 @@ void ExtensionFunctionRegistry::ResetFunctions() { RegisterFunction<CanOpenNewWindowsBookmarkFunction>(); // History - RegisterFunction<AddUrlHistoryFunction>(); - RegisterFunction<DeleteAllHistoryFunction>(); - RegisterFunction<DeleteRangeHistoryFunction>(); - RegisterFunction<DeleteUrlHistoryFunction>(); - RegisterFunction<GetMostVisitedHistoryFunction>(); - RegisterFunction<GetVisitsHistoryFunction>(); - RegisterFunction<SearchHistoryFunction>(); + RegisterFunction<extensions::AddUrlHistoryFunction>(); + RegisterFunction<extensions::DeleteAllHistoryFunction>(); + RegisterFunction<extensions::DeleteRangeHistoryFunction>(); + RegisterFunction<extensions::DeleteUrlHistoryFunction>(); + RegisterFunction<extensions::GetMostVisitedHistoryFunction>(); + RegisterFunction<extensions::GetVisitsHistoryFunction>(); + RegisterFunction<extensions::SearchHistoryFunction>(); // Idle RegisterFunction<extensions::IdleQueryStateFunction>(); diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 7b03257..121e38d 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -66,7 +66,6 @@ #include "chrome/browser/extensions/shell_window_registry.h" #include "chrome/browser/extensions/unpacked_installer.h" #include "chrome/browser/extensions/updater/extension_updater.h" -#include "chrome/browser/history/history_extension_api.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" @@ -520,7 +519,6 @@ void ExtensionService::InitEventRouters() { return; #if defined(ENABLE_EXTENSIONS) - history_event_router_.reset(new HistoryExtensionEventRouter(profile_)); browser_event_router_.reset(new extensions::BrowserEventRouter(profile_)); bookmark_event_router_.reset(new BookmarkExtensionEventRouter( BookmarkModelFactory::GetForProfile(profile_))); diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index 2d45550..b75e3e9 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -45,7 +45,6 @@ class CommandLine; class ExtensionErrorUI; class ExtensionSyncData; class ExtensionToolbarModel; -class HistoryExtensionEventRouter; class GURL; class Profile; class Version; @@ -951,8 +950,6 @@ class ExtensionService // TODO(yoz): None of these should be owned by ExtensionService. // crbug.com/159265 - scoped_ptr<HistoryExtensionEventRouter> history_event_router_; - scoped_ptr<extensions::BrowserEventRouter> browser_event_router_; scoped_ptr<BookmarkExtensionEventRouter> bookmark_event_router_; diff --git a/chrome/browser/history/DEPS b/chrome/browser/history/DEPS index 5156fc6..f54d784 100644 --- a/chrome/browser/history/DEPS +++ b/chrome/browser/history/DEPS @@ -25,9 +25,7 @@ include_rules = [ "!chrome/browser/chromeos/login/existing_user_controller.h", "!chrome/browser/content_settings/cookie_settings.h", "!chrome/browser/diagnostics/sqlite_diagnostics.h", - "!chrome/browser/extensions/event_router.h", "!chrome/browser/extensions/extension_function.h", - "!chrome/browser/extensions/extension_system.h", "!chrome/browser/favicon/favicon_service.h", "!chrome/browser/instant/instant_loader.h", "!chrome/browser/prefs/pref_service.h", diff --git a/chrome/browser/profiles/profile_dependency_manager.cc b/chrome/browser/profiles/profile_dependency_manager.cc index 2ebdaed..652c0e1 100644 --- a/chrome/browser/profiles/profile_dependency_manager.cc +++ b/chrome/browser/profiles/profile_dependency_manager.cc @@ -20,6 +20,7 @@ #include "chrome/browser/extensions/api/dial/dial_api_factory.h" #include "chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h" #include "chrome/browser/extensions/api/font_settings/font_settings_api_factory.h" +#include "chrome/browser/extensions/api/history/history_api_factory.h" #include "chrome/browser/extensions/api/idle/idle_manager_factory.h" #include "chrome/browser/extensions/api/managed_mode/managed_mode_api_factory.h" #include "chrome/browser/extensions/api/management/management_api_factory.h" @@ -237,6 +238,7 @@ void ProfileDependencyManager::AssertFactoriesBuilt() { extensions::DialAPIFactory::GetInstance(); extensions::ExtensionSystemFactory::GetInstance(); extensions::FontSettingsAPIFactory::GetInstance(); + extensions::HistoryAPIFactory::GetInstance(); extensions::IdleManagerFactory::GetInstance(); extensions::ManagedModeAPIFactory::GetInstance(); extensions::MediaGalleriesPrivateAPIFactory::GetInstance(); diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 9dd3dff..7008278 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -2312,8 +2312,6 @@ 'browser/accessibility/accessibility_extension_api.h', 'browser/bookmarks/bookmark_extension_api.cc', 'browser/bookmarks/bookmark_extension_api.h', - 'browser/history/history_extension_api.cc', - 'browser/history/history_extension_api.h', 'browser/history/top_sites_extension_api.cc', 'browser/history/top_sites_extension_api.h', 'browser/infobars/infobar_extension_api.cc', diff --git a/chrome/chrome_browser_extensions.gypi b/chrome/chrome_browser_extensions.gypi index d049827..de5f82d5 100644 --- a/chrome/chrome_browser_extensions.gypi +++ b/chrome/chrome_browser_extensions.gypi @@ -191,6 +191,10 @@ 'browser/extensions/api/font_settings/font_settings_api.h', 'browser/extensions/api/font_settings/font_settings_api_factory.cc', 'browser/extensions/api/font_settings/font_settings_api_factory.h', + 'browser/extensions/api/history/history_api.h', + 'browser/extensions/api/history/history_api.cc', + 'browser/extensions/api/history/history_api_factory.h', + 'browser/extensions/api/history/history_api_factory.cc', 'browser/extensions/api/i18n/i18n_api.cc', 'browser/extensions/api/i18n/i18n_api.h', 'browser/extensions/api/identity/identity_api.cc', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index c986f62..2c8331f 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -935,6 +935,7 @@ 'browser/extensions/api/extension_action/script_badge_apitest.cc', 'browser/extensions/api/file_system/file_system_apitest.cc', 'browser/extensions/api/font_settings/font_settings_apitest.cc', + 'browser/extensions/api/history/history_apitest.cc', 'browser/extensions/api/i18n/i18n_apitest.cc', 'browser/extensions/api/identity/identity_apitest.cc', 'browser/extensions/api/idle/idle_apitest.cc', @@ -1055,7 +1056,6 @@ 'browser/google_apis/mock_drive_service.cc', 'browser/google_apis/mock_drive_service.h', 'browser/history/history_browsertest.cc', - 'browser/history/history_extension_apitest.cc', 'browser/history/multipart_browsertest.cc', 'browser/history/redirect_browsertest.cc', 'browser/history/top_sites_extension_test.cc', |