summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-24 20:29:07 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-24 20:29:07 +0000
commitd2e6bd6562fc25f6e01e333602c132ea14a1a17e (patch)
tree2eedba3e87d82c019fac8f934b87b423abbc2378
parent1a157553f8382a9c09cb8a5ccdfa798ac49cb10c (diff)
downloadchromium_src-d2e6bd6562fc25f6e01e333602c132ea14a1a17e.zip
chromium_src-d2e6bd6562fc25f6e01e333602c132ea14a1a17e.tar.gz
chromium_src-d2e6bd6562fc25f6e01e333602c132ea14a1a17e.tar.bz2
Move history extension API implementation to history dir.
We're moving all the extension api implementations out of browser/extensions into the directory with the code they are automating. BUG=101244 Review URL: http://codereview.chromium.org/8372021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106968 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc2
-rw-r--r--chrome/browser/extensions/extension_history_api_constants.cc35
-rw-r--r--chrome/browser/extensions/extension_history_api_constants.h44
-rw-r--r--chrome/browser/extensions/extension_service.cc4
-rw-r--r--chrome/browser/extensions/extension_service.h4
-rw-r--r--chrome/browser/history/history_extension_api.cc (renamed from chrome/browser/extensions/extension_history_api.cc)101
-rw-r--r--chrome/browser/history/history_extension_api.h (renamed from chrome/browser/extensions/extension_history_api.h)14
-rw-r--r--chrome/browser/history/history_extension_apitest.cc (renamed from chrome/browser/extensions/extension_history_apitest.cc)12
-rw-r--r--chrome/chrome_browser.gypi6
-rw-r--r--chrome/chrome_tests.gypi2
10 files changed, 83 insertions, 141 deletions
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index e2c8dd40..4dae311 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -26,7 +26,6 @@
#include "chrome/browser/extensions/extension_debugger_api.h"
#include "chrome/browser/extensions/extension_downloads_api.h"
#include "chrome/browser/extensions/extension_function.h"
-#include "chrome/browser/extensions/extension_history_api.h"
#include "chrome/browser/extensions/extension_i18n_api.h"
#include "chrome/browser/extensions/extension_idle_api.h"
#include "chrome/browser/extensions/extension_management_api.h"
@@ -56,6 +55,7 @@
#include "chrome/browser/extensions/speech_input/extension_speech_input_api.h"
#include "chrome/browser/external_protocol/external_protocol_handler.h"
#include "chrome/browser/infobars/infobar_extension_api.h"
+#include "chrome/browser/history/history_extension_api.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/chrome_render_message_filter.h"
#include "chrome/browser/ui/browser_list.h"
diff --git a/chrome/browser/extensions/extension_history_api_constants.cc b/chrome/browser/extensions/extension_history_api_constants.cc
deleted file mode 100644
index c5c75b0..0000000
--- a/chrome/browser/extensions/extension_history_api_constants.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 2009 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/extension_history_api_constants.h"
-
-namespace extension_history_api_constants {
-
-const char kAllHistoryKey[] = "allHistory";
-const char kEndTimeKey[] = "endTime";
-const char kFaviconUrlKey[] = "favIconUrl";
-const char kIdKey[] = "id";
-const char kLastVisitdKey[] = "lastVisitTime";
-const char kMaxResultsKey[] = "maxResults";
-const char kNewKey[] = "new";
-const char kReferringVisitId[] = "referringVisitId";
-const char kRemovedKey[] = "removed";
-const char kStartTimeKey[] = "startTime";
-const char kTextKey[] = "text";
-const char kTitleKey[] = "title";
-const char kTypedCountKey[] = "typedCount";
-const char kVisitCountKey[] = "visitCount";
-const char kTransition[] = "transition";
-const char kUrlKey[] = "url";
-const char kUrlsKey[] = "urls";
-const char kVisitId[] = "visitId";
-const char kVisitTime[] = "visitTime";
-
-const char kOnVisited[] = "history.onVisited";
-const char kOnVisitRemoved[] = "history.onVisitRemoved";
-
-const char kInvalidIdError[] = "History item id is invalid.";
-const char kInvalidUrlError[] = "Url is invalid.";
-
-} // namespace extension_history_api_constants
diff --git a/chrome/browser/extensions/extension_history_api_constants.h b/chrome/browser/extensions/extension_history_api_constants.h
deleted file mode 100644
index 74ac859..0000000
--- a/chrome/browser/extensions/extension_history_api_constants.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) 2009 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.
-
-// Constants used to for the History API.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_CONSTANTS_H_
-#define CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_CONSTANTS_H_
-#pragma once
-
-namespace extension_history_api_constants {
-
-// Keys.
-extern const char kAllHistoryKey[];
-extern const char kEndTimeKey[];
-extern const char kFaviconUrlKey[];
-extern const char kIdKey[];
-extern const char kLastVisitdKey[];
-extern const char kMaxResultsKey[];
-extern const char kNewKey[];
-extern const char kReferringVisitId[];
-extern const char kRemovedKey[];
-extern const char kStartTimeKey[];
-extern const char kTextKey[];
-extern const char kTitleKey[];
-extern const char kTypedCountKey[];
-extern const char kVisitCountKey[];
-extern const char kTransition[];
-extern const char kUrlKey[];
-extern const char kUrlsKey[];
-extern const char kVisitId[];
-extern const char kVisitTime[];
-
-// Events.
-extern const char kOnVisited[];
-extern const char kOnVisitRemoved[];
-
-// Errors.
-extern const char kInvalidIdError[];
-extern const char kInvalidUrlError[];
-
-}; // namespace extension_history_api_constants
-
-#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_CONSTANTS_H_
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index c3c6e16..1fac259 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -41,7 +41,6 @@
#include "chrome/browser/extensions/extension_downloads_api.h"
#include "chrome/browser/extensions/extension_error_reporter.h"
#include "chrome/browser/extensions/extension_global_error.h"
-#include "chrome/browser/extensions/extension_history_api.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_input_ime_api.h"
#include "chrome/browser/extensions/extension_install_ui.h"
@@ -57,6 +56,7 @@
#include "chrome/browser/extensions/external_extension_provider_impl.h"
#include "chrome/browser/extensions/external_extension_provider_interface.h"
#include "chrome/browser/extensions/pending_extension_manager.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"
@@ -711,7 +711,7 @@ void ExtensionService::InitEventRouters() {
return;
downloads_event_router_.reset(new ExtensionDownloadsEventRouter(profile_));
- history_event_router_.reset(new ExtensionHistoryEventRouter());
+ history_event_router_.reset(new HistoryExtensionEventRouter());
history_event_router_->ObserveProfile(profile_);
browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_));
browser_event_router_->Init();
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 4673c89..79fe477 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -54,7 +54,7 @@ class ExtensionCookiesEventRouter;
class ExtensionDownloadsEventRouter;
class ExtensionFileBrowserEventRouter;
class ExtensionGlobalError;
-class ExtensionHistoryEventRouter;
+class HistoryExtensionEventRouter;
class ExtensionInstallUI;
class ExtensionManagementEventRouter;
class ExtensionPreferenceEventRouter;
@@ -805,7 +805,7 @@ class ExtensionService
scoped_ptr<ExtensionDownloadsEventRouter> downloads_event_router_;
- scoped_ptr<ExtensionHistoryEventRouter> history_event_router_;
+ scoped_ptr<HistoryExtensionEventRouter> history_event_router_;
scoped_ptr<ExtensionBrowserEventRouter> browser_event_router_;
diff --git a/chrome/browser/extensions/extension_history_api.cc b/chrome/browser/history/history_extension_api.cc
index cdae1f4..1c7d1e6 100644
--- a/chrome/browser/extensions/extension_history_api.cc
+++ b/chrome/browser/history/history_extension_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/extensions/extension_history_api.h"
+#include "chrome/browser/history/history_extension_api.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -13,7 +13,6 @@
#include "base/task.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_event_router.h"
-#include "chrome/browser/extensions/extension_history_api_constants.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/profiles/profile.h"
@@ -21,23 +20,47 @@
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
-namespace keys = extension_history_api_constants;
-
namespace {
+const char kAllHistoryKey[] = "allHistory";
+const char kEndTimeKey[] = "endTime";
+const char kFaviconUrlKey[] = "favIconUrl";
+const char kIdKey[] = "id";
+const char kLastVisitdKey[] = "lastVisitTime";
+const char kMaxResultsKey[] = "maxResults";
+const char kNewKey[] = "new";
+const char kReferringVisitId[] = "referringVisitId";
+const char kRemovedKey[] = "removed";
+const char kStartTimeKey[] = "startTime";
+const char kTextKey[] = "text";
+const char kTitleKey[] = "title";
+const char kTypedCountKey[] = "typedCount";
+const char kVisitCountKey[] = "visitCount";
+const char kTransition[] = "transition";
+const char kUrlKey[] = "url";
+const char kUrlsKey[] = "urls";
+const char kVisitId[] = "visitId";
+const char kVisitTime[] = "visitTime";
+
+const char kOnVisited[] = "history.onVisited";
+const char kOnVisitRemoved[] = "history.onVisitRemoved";
+
+const char kInvalidIdError[] = "History item id is invalid.";
+const char kInvalidUrlError[] = "Url is invalid.";
+
double MilliSecondsFromTime(const base::Time& time) {
return 1000 * time.ToDoubleT();
}
void GetHistoryItemDictionary(const history::URLRow& row,
DictionaryValue* value) {
- value->SetString(keys::kIdKey, base::Int64ToString(row.id()));
- value->SetString(keys::kUrlKey, row.url().spec());
- value->SetString(keys::kTitleKey, row.title());
- value->SetDouble(keys::kLastVisitdKey,
+ value->SetString(kIdKey, base::Int64ToString(row.id()));
+ value->SetString(kUrlKey, row.url().spec());
+ value->SetString(kTitleKey, row.title());
+ value->SetDouble(kLastVisitdKey,
MilliSecondsFromTime(row.last_visit()));
- value->SetInteger(keys::kTypedCountKey, row.typed_count());
- value->SetInteger(keys::kVisitCountKey, row.visit_count());
+ value->SetInteger(kTypedCountKey, row.typed_count());
+ value->SetInteger(kVisitCountKey, row.visit_count());
}
void AddHistoryNode(const history::URLRow& row, ListValue* list) {
@@ -48,16 +71,16 @@ void AddHistoryNode(const history::URLRow& row, ListValue* list) {
void GetVisitInfoDictionary(const history::VisitRow& row,
DictionaryValue* value) {
- value->SetString(keys::kIdKey, base::Int64ToString(row.url_id));
- value->SetString(keys::kVisitId, base::Int64ToString(row.visit_id));
- value->SetDouble(keys::kVisitTime, MilliSecondsFromTime(row.visit_time));
- value->SetString(keys::kReferringVisitId,
+ value->SetString(kIdKey, base::Int64ToString(row.url_id));
+ value->SetString(kVisitId, base::Int64ToString(row.visit_id));
+ value->SetDouble(kVisitTime, MilliSecondsFromTime(row.visit_time));
+ value->SetString(kReferringVisitId,
base::Int64ToString(row.referring_visit));
const char* trans =
content::PageTransitionGetCoreTransitionString(row.transition);
DCHECK(trans) << "Invalid transition.";
- value->SetString(keys::kTransition, trans);
+ value->SetString(kTransition, trans);
}
void AddVisitNode(const history::VisitRow& row, ListValue* list) {
@@ -68,11 +91,11 @@ void AddVisitNode(const history::VisitRow& row, ListValue* list) {
} // namespace
-ExtensionHistoryEventRouter::ExtensionHistoryEventRouter() {}
+HistoryExtensionEventRouter::HistoryExtensionEventRouter() {}
-ExtensionHistoryEventRouter::~ExtensionHistoryEventRouter() {}
+HistoryExtensionEventRouter::~HistoryExtensionEventRouter() {}
-void ExtensionHistoryEventRouter::ObserveProfile(Profile* profile) {
+void HistoryExtensionEventRouter::ObserveProfile(Profile* profile) {
CHECK(registrar_.IsEmpty());
const content::Source<Profile> source = content::Source<Profile>(profile);
registrar_.Add(this,
@@ -83,7 +106,7 @@ void ExtensionHistoryEventRouter::ObserveProfile(Profile* profile) {
source);
}
-void ExtensionHistoryEventRouter::Observe(
+void HistoryExtensionEventRouter::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
@@ -103,7 +126,7 @@ void ExtensionHistoryEventRouter::Observe(
}
}
-void ExtensionHistoryEventRouter::HistoryUrlVisited(
+void HistoryExtensionEventRouter::HistoryUrlVisited(
Profile* profile,
const history::URLVisitedDetails* details) {
ListValue args;
@@ -113,30 +136,30 @@ void ExtensionHistoryEventRouter::HistoryUrlVisited(
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
- DispatchEvent(profile, keys::kOnVisited, json_args);
+ DispatchEvent(profile, kOnVisited, json_args);
}
-void ExtensionHistoryEventRouter::HistoryUrlsRemoved(
+void HistoryExtensionEventRouter::HistoryUrlsRemoved(
Profile* profile,
const history::URLsDeletedDetails* details) {
ListValue args;
DictionaryValue* dict = new DictionaryValue();
- dict->SetBoolean(keys::kAllHistoryKey, details->all_history);
+ dict->SetBoolean(kAllHistoryKey, details->all_history);
ListValue* urls = new ListValue();
for (std::set<GURL>::const_iterator iterator = details->urls.begin();
iterator != details->urls.end();
++iterator) {
urls->Append(new StringValue(iterator->spec()));
}
- dict->Set(keys::kUrlsKey, urls);
+ dict->Set(kUrlsKey, urls);
args.Append(dict);
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
- DispatchEvent(profile, keys::kOnVisitRemoved, json_args);
+ DispatchEvent(profile, kOnVisitRemoved, json_args);
}
-void ExtensionHistoryEventRouter::DispatchEvent(Profile* profile,
+void HistoryExtensionEventRouter::DispatchEvent(Profile* profile,
const char* event_name,
const std::string& json_args) {
if (profile && profile->GetExtensionEventRouter()) {
@@ -160,7 +183,7 @@ bool HistoryFunction::GetUrlFromValue(Value* value, GURL* url) {
GURL temp_url(url_string);
if (!temp_url.is_valid()) {
- error_ = keys::kInvalidUrlError;
+ error_ = kInvalidUrlError;
return false;
}
url->Swap(&temp_url);
@@ -213,7 +236,7 @@ bool GetVisitsHistoryFunction::RunAsyncImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &json));
Value* value;
- EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kUrlKey, &value));
+ EXTENSION_FUNCTION_VALIDATE(json->Get(kUrlKey, &value));
GURL url;
if (!GetUrlFromValue(value, &url))
@@ -252,24 +275,24 @@ bool SearchHistoryFunction::RunAsyncImpl() {
// Initialize the HistoryQuery
string16 search_text;
- EXTENSION_FUNCTION_VALIDATE(json->GetString(keys::kTextKey, &search_text));
+ EXTENSION_FUNCTION_VALIDATE(json->GetString(kTextKey, &search_text));
history::QueryOptions options;
options.SetRecentDayRange(1);
options.max_count = 100;
- if (json->HasKey(keys::kStartTimeKey)) { // Optional.
+ if (json->HasKey(kStartTimeKey)) { // Optional.
Value* value;
- EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kStartTimeKey, &value));
+ EXTENSION_FUNCTION_VALIDATE(json->Get(kStartTimeKey, &value));
EXTENSION_FUNCTION_VALIDATE(GetTimeFromValue(value, &options.begin_time));
}
- if (json->HasKey(keys::kEndTimeKey)) { // Optional.
+ if (json->HasKey(kEndTimeKey)) { // Optional.
Value* value;
- EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kEndTimeKey, &value));
+ EXTENSION_FUNCTION_VALIDATE(json->Get(kEndTimeKey, &value));
EXTENSION_FUNCTION_VALIDATE(GetTimeFromValue(value, &options.end_time));
}
- if (json->HasKey(keys::kMaxResultsKey)) { // Optional.
- EXTENSION_FUNCTION_VALIDATE(json->GetInteger(keys::kMaxResultsKey,
+ if (json->HasKey(kMaxResultsKey)) { // Optional.
+ EXTENSION_FUNCTION_VALIDATE(json->GetInteger(kMaxResultsKey,
&options.max_count));
}
@@ -302,7 +325,7 @@ bool AddUrlHistoryFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &json));
Value* value;
- EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kUrlKey, &value));
+ EXTENSION_FUNCTION_VALIDATE(json->Get(kUrlKey, &value));
GURL url;
if (!GetUrlFromValue(value, &url))
@@ -320,7 +343,7 @@ bool DeleteUrlHistoryFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &json));
Value* value;
- EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kUrlKey, &value));
+ EXTENSION_FUNCTION_VALIDATE(json->Get(kUrlKey, &value));
GURL url;
if (!GetUrlFromValue(value, &url))
@@ -338,11 +361,11 @@ bool DeleteRangeHistoryFunction::RunAsyncImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &json));
Value* value = NULL;
- EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kStartTimeKey, &value));
+ EXTENSION_FUNCTION_VALIDATE(json->Get(kStartTimeKey, &value));
base::Time begin_time;
EXTENSION_FUNCTION_VALIDATE(GetTimeFromValue(value, &begin_time));
- EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kEndTimeKey, &value));
+ EXTENSION_FUNCTION_VALIDATE(json->Get(kEndTimeKey, &value));
base::Time end_time;
EXTENSION_FUNCTION_VALIDATE(GetTimeFromValue(value, &end_time));
diff --git a/chrome/browser/extensions/extension_history_api.h b/chrome/browser/history/history_extension_api.h
index f455a1c..e66ea76 100644
--- a/chrome/browser/extensions/extension_history_api.h
+++ b/chrome/browser/history/history_extension_api.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_H_
-#define CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_H_
+#ifndef CHROME_BROWSER_HISTORY_HISTORY_EXTENSION_API_H_
+#define CHROME_BROWSER_HISTORY_HISTORY_EXTENSION_API_H_
#pragma once
#include <string>
@@ -16,10 +16,10 @@
// Observes History service and routes the notifications as events to the
// extension system.
-class ExtensionHistoryEventRouter : public content::NotificationObserver {
+class HistoryExtensionEventRouter : public content::NotificationObserver {
public:
- explicit ExtensionHistoryEventRouter();
- virtual ~ExtensionHistoryEventRouter();
+ explicit HistoryExtensionEventRouter();
+ virtual ~HistoryExtensionEventRouter();
void ObserveProfile(Profile* profile);
@@ -42,7 +42,7 @@ class ExtensionHistoryEventRouter : public content::NotificationObserver {
// Used for tracking registrations to history service notifications.
content::NotificationRegistrar registrar_;
- DISALLOW_COPY_AND_ASSIGN(ExtensionHistoryEventRouter);
+ DISALLOW_COPY_AND_ASSIGN(HistoryExtensionEventRouter);
};
@@ -137,4 +137,4 @@ class DeleteRangeHistoryFunction : public HistoryFunctionWithCallback {
void DeleteComplete();
};
-#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_H_
+#endif // CHROME_BROWSER_HISTORY_HISTORY_EXTENSION_API_H_
diff --git a/chrome/browser/extensions/extension_history_apitest.cc b/chrome/browser/history/history_extension_apitest.cc
index 506319f..129c9dc 100644
--- a/chrome/browser/extensions/extension_history_apitest.cc
+++ b/chrome/browser/history/history_extension_apitest.cc
@@ -7,7 +7,7 @@
#include "chrome/browser/extensions/extension_apitest.h"
#include "net/base/mock_host_resolver.h"
-class ExtensionHistoryApiTest : public ExtensionApiTest {
+class HistoryExtensionApiTest : public ExtensionApiTest {
public:
virtual void SetUpInProcessBrowserTestFixture() {
ExtensionApiTest::SetUpInProcessBrowserTestFixture();
@@ -21,11 +21,11 @@ class ExtensionHistoryApiTest : public ExtensionApiTest {
// Full text search indexing sometimes exceeds a timeout.
// Fix this as part of crbug/76170.
-IN_PROC_BROWSER_TEST_F(ExtensionHistoryApiTest, DISABLED_MiscSearch) {
+IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, DISABLED_MiscSearch) {
ASSERT_TRUE(RunExtensionSubtest("history", "misc_search.html")) << message_;
}
-IN_PROC_BROWSER_TEST_F(ExtensionHistoryApiTest, TimedSearch) {
+IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, TimedSearch) {
ASSERT_TRUE(RunExtensionSubtest("history", "timed_search.html")) << message_;
}
@@ -35,12 +35,12 @@ IN_PROC_BROWSER_TEST_F(ExtensionHistoryApiTest, TimedSearch) {
#else
#define MAYBE_Delete Delete
#endif
-IN_PROC_BROWSER_TEST_F(ExtensionHistoryApiTest, MAYBE_Delete) {
+IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, MAYBE_Delete) {
ASSERT_TRUE(RunExtensionSubtest("history", "delete.html")) << message_;
}
// See crbug.com/79074
-IN_PROC_BROWSER_TEST_F(ExtensionHistoryApiTest, FLAKY_GetVisits) {
+IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, FLAKY_GetVisits) {
ASSERT_TRUE(RunExtensionSubtest("history", "get_visits.html")) << message_;
}
@@ -52,7 +52,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionHistoryApiTest, FLAKY_GetVisits) {
#define MAYBE_SearchAfterAdd SearchAfterAdd
#endif
-IN_PROC_BROWSER_TEST_F(ExtensionHistoryApiTest, MAYBE_SearchAfterAdd) {
+IN_PROC_BROWSER_TEST_F(HistoryExtensionApiTest, MAYBE_SearchAfterAdd) {
ASSERT_TRUE(RunExtensionSubtest("history", "search_after_add.html"))
<< message_;
}
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 8493041..ffb1340 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1024,10 +1024,6 @@
'browser/extensions/extension_global_error.h',
'browser/extensions/extension_global_error_badge.cc',
'browser/extensions/extension_global_error_badge.h',
- 'browser/extensions/extension_history_api.cc',
- 'browser/extensions/extension_history_api.h',
- 'browser/extensions/extension_history_api_constants.cc',
- 'browser/extensions/extension_history_api_constants.h',
'browser/extensions/extension_host.cc',
'browser/extensions/extension_host.h',
'browser/extensions/extension_host_mac.h',
@@ -1327,6 +1323,8 @@
'browser/history/history_backend.h',
'browser/history/history_database.cc',
'browser/history/history_database.h',
+ 'browser/history/history_extension_api.cc',
+ 'browser/history/history_extension_api.h',
'browser/history/history_marshaling.h',
'browser/history/history_notifications.cc',
'browser/history/history_notifications.h',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 15479b5..13f2c27 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -2390,7 +2390,6 @@
'browser/extensions/extension_function_test_utils.h',
'browser/extensions/extension_geolocation_apitest.cc',
'browser/extensions/extension_get_views_apitest.cc',
- 'browser/extensions/extension_history_apitest.cc',
'browser/extensions/extension_i18n_apitest.cc',
'browser/extensions/extension_icon_source_apitest.cc',
'browser/extensions/extension_idle_apitest.cc',
@@ -2450,6 +2449,7 @@
'browser/geolocation/geolocation_browsertest.cc',
'browser/gpu_browsertest.cc',
'browser/history/history_browsertest.cc',
+ 'browser/history/history_extension_apitest.cc',
'browser/idbbindingutilities_browsertest.cc',
'browser/infobars/infobar_extension_apitest.cc',
'browser/importer/toolbar_importer_utils_browsertest.cc',