Generate all extension schema namespaces as "api" and instead vary the generated bundle names.

At the moment the 3 modules that use extension API schemas, those in
extensions/common/api, chrome/common/extensions/api, and extensions/shell/api,
are generated with different C++ namespaces: "core_api", "api", and
"shell::api" respectively.

This is a pointless distinction to make since as far as JS is concerned they
must all go on the window.chrome object, therefore namespace conflicts are
impossible. It just ends up adding code noise.

The only problem it solves is that all bundle compiles are generated to the
same name, "GeneratedSchemas" and "GeneratedFunctionRegistry". This patch
solves that a different way, by adding a JSON schema compiler option to give
those generated classes a prefix such that they are "GeneratedSchemas",
"ChromeGeneratedSchemas", and "ShellGeneratedSchemas" respectively.
This lets us to a global substitution from "core_api" to just "api".

[email protected], [email protected]
[email protected]

Review URL: https://codereview.chromium.org/1226353004

Cr-Commit-Position: refs/heads/master@{#340119}
diff --git a/chrome/browser/extensions/api/declarative/declarative_apitest.cc b/chrome/browser/extensions/api/declarative/declarative_apitest.cc
index adec781..0131758 100644
--- a/chrome/browser/extensions/api/declarative/declarative_apitest.cc
+++ b/chrome/browser/extensions/api/declarative/declarative_apitest.cc
@@ -113,7 +113,7 @@
             RulesRegistryService::kDefaultRulesRegistryID,
             extensions::declarative_webrequest_constants::kOnRequest);
 
-    std::vector<linked_ptr<core_api::events::Rule>> rules;
+    std::vector<linked_ptr<api::events::Rule>> rules;
     BrowserThread::PostTask(
         BrowserThread::IO,
         FROM_HERE,
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_service_unittest.cc b/chrome/browser/extensions/api/declarative/rules_registry_service_unittest.cc
index 48652b8c..0f0d942c 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_service_unittest.cc
+++ b/chrome/browser/extensions/api/declarative/rules_registry_service_unittest.cc
@@ -20,8 +20,8 @@
 
 void InsertRule(scoped_refptr<extensions::RulesRegistry> registry,
                 const std::string& id) {
-  std::vector<linked_ptr<extensions::core_api::events::Rule> > add_rules;
-  add_rules.push_back(make_linked_ptr(new extensions::core_api::events::Rule));
+  std::vector<linked_ptr<extensions::api::events::Rule>> add_rules;
+  add_rules.push_back(make_linked_ptr(new extensions::api::events::Rule));
   add_rules[0]->id.reset(new std::string(id));
   std::string error = registry->AddRules(kExtensionId, add_rules);
   EXPECT_TRUE(error.empty());
@@ -29,7 +29,7 @@
 
 void VerifyNumberOfRules(scoped_refptr<extensions::RulesRegistry> registry,
                          size_t expected_number_of_rules) {
-  std::vector<linked_ptr<extensions::core_api::events::Rule> > get_rules;
+  std::vector<linked_ptr<extensions::api::events::Rule>> get_rules;
   registry->GetAllRules(kExtensionId, &get_rules);
   EXPECT_EQ(expected_number_of_rules, get_rules.size());
 }
diff --git a/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc b/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc
index fb42d5ce..70e0e6b 100644
--- a/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc
+++ b/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc
@@ -71,8 +71,8 @@
   std::string AddRule(const std::string& extension_id,
                       const std::string& rule_id,
                       TestRulesRegistry* registry) {
-    std::vector<linked_ptr<core_api::events::Rule>> add_rules;
-    add_rules.push_back(make_linked_ptr(new core_api::events::Rule));
+    std::vector<linked_ptr<api::events::Rule>> add_rules;
+    add_rules.push_back(make_linked_ptr(new api::events::Rule));
     add_rules[0]->id.reset(new std::string(rule_id));
     return registry->AddRules(extension_id, add_rules);
   }
@@ -91,7 +91,7 @@
 
   int GetNumberOfRules(const std::string& extension_id,
                        TestRulesRegistry* registry) {
-    std::vector<linked_ptr<core_api::events::Rule>> get_rules;
+    std::vector<linked_ptr<api::events::Rule>> get_rules;
     registry->GetAllRules(extension_id, &get_rules);
     return get_rules.size();
   }
@@ -187,7 +187,7 @@
   std::vector<std::string> rules_to_get;
   rules_to_get.push_back(kRuleId);
   rules_to_get.push_back("unknown_rule");
-  std::vector<linked_ptr<core_api::events::Rule>> gotten_rules;
+  std::vector<linked_ptr<api::events::Rule>> gotten_rules;
   registry_->GetRules(extension1_->id(), rules_to_get, &gotten_rules);
   ASSERT_EQ(1u, gotten_rules.size());
   ASSERT_TRUE(gotten_rules[0]->id.get());
@@ -201,7 +201,7 @@
   EXPECT_EQ("", AddRule(extension2_->id(), kRuleId));
 
   // Check that we get the correct rules.
-  std::vector<linked_ptr<core_api::events::Rule>> gotten_rules;
+  std::vector<linked_ptr<api::events::Rule>> gotten_rules;
   registry_->GetAllRules(extension1_->id(), &gotten_rules);
   EXPECT_EQ(2u, gotten_rules.size());
   ASSERT_TRUE(gotten_rules[0]->id.get());
diff --git a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.cc b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.cc
index e51878d..e9bda2e 100644
--- a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.cc
+++ b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.cc
@@ -175,7 +175,7 @@
 
 scoped_ptr<const ChromeContentRulesRegistry::ContentRule>
 ChromeContentRulesRegistry::CreateRule(const Extension* extension,
-                                       const core_api::events::Rule& api_rule,
+                                       const api::events::Rule& api_rule,
                                        std::string* error) {
   ScopedVector<const ContentCondition> conditions;
   for (const linked_ptr<base::Value>& value : api_rule.conditions) {
@@ -260,7 +260,7 @@
 
 std::string ChromeContentRulesRegistry::AddRulesImpl(
     const std::string& extension_id,
-    const std::vector<linked_ptr<core_api::events::Rule>>& rules) {
+    const std::vector<linked_ptr<api::events::Rule>>& rules) {
   EvaluationScope evaluation_scope(this);
   const Extension* extension = ExtensionRegistry::Get(browser_context())
       ->GetInstalledExtension(extension_id);
@@ -269,7 +269,7 @@
   std::string error;
   RulesMap new_content_rules;
 
-  for (const linked_ptr<core_api::events::Rule>& rule : rules) {
+  for (const linked_ptr<api::events::Rule>& rule : rules) {
     ExtensionRuleIdPair rule_id(extension, *rule->id);
     DCHECK(content_rules_.find(rule_id) == content_rules_.end());
 
diff --git a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h
index e6f6343..a96c42a 100644
--- a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h
+++ b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h
@@ -50,7 +50,7 @@
 //
 // Here is the high level overview of this functionality:
 //
-// core_api::events::Rule consists of conditions and actions, these are
+// api::events::Rule consists of conditions and actions, these are
 // represented as a ContentRule with ContentConditions and ContentRuleActions.
 //
 // The evaluation of URL related condition attributes (host_suffix, path_prefix)
@@ -84,7 +84,7 @@
   // RulesRegistry:
   std::string AddRulesImpl(
       const std::string& extension_id,
-      const std::vector<linked_ptr<core_api::events::Rule>>& rules) override;
+      const std::vector<linked_ptr<api::events::Rule>>& rules) override;
   std::string RemoveRulesImpl(
       const std::string& extension_id,
       const std::vector<std::string>& rule_identifiers) override;
@@ -156,10 +156,9 @@
   // and ContentAction.  |extension| may be NULL in tests.  If |error| is empty,
   // the translation was successful and the returned rule is internally
   // consistent.
-  scoped_ptr<const ContentRule> CreateRule(
-      const Extension* extension,
-      const core_api::events::Rule& api_rule,
-      std::string* error);
+  scoped_ptr<const ContentRule> CreateRule(const Extension* extension,
+                                           const api::events::Rule& api_rule,
+                                           std::string* error);
 
   // True if this object is managing the rules for |context|.
   bool ManagingRulesForBrowserContext(content::BrowserContext* context);
diff --git a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc
index 97ed008..eb7ff39 100644
--- a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc
+++ b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc
@@ -51,8 +51,8 @@
   EXPECT_EQ(0u, registry->GetActiveRulesCountForTesting());
 
   // Add a rule.
-  linked_ptr<core_api::events::Rule> rule(new core_api::events::Rule);
-  core_api::events::Rule::Populate(
+  linked_ptr<api::events::Rule> rule(new api::events::Rule);
+  api::events::Rule::Populate(
       *base::test::ParseJson(
           "{\n"
           "  \"id\": \"rule1\",\n"
@@ -67,7 +67,7 @@
           "  ]\n"
           "}"),
       rule.get());
-  std::vector<linked_ptr<core_api::events::Rule>> rules;
+  std::vector<linked_ptr<api::events::Rule>> rules;
   rules.push_back(rule);
 
   const Extension* extension = env()->MakeExtension(*base::test::ParseJson(
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc
index f932244..8da1830 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc
@@ -96,7 +96,7 @@
 
   // Returns a rule that roughly matches http://*.example.com and
   // https://www.example.com and cancels it
-  linked_ptr<core_api::events::Rule> CreateRule1() {
+  linked_ptr<api::events::Rule> CreateRule1() {
     base::ListValue* scheme_http = new base::ListValue();
     scheme_http->Append(new base::StringValue("http"));
     base::DictionaryValue* http_condition_dict = new base::DictionaryValue();
@@ -121,7 +121,7 @@
     base::DictionaryValue action_dict;
     action_dict.SetString(keys::kInstanceTypeKey, keys::kCancelRequestType);
 
-    linked_ptr<core_api::events::Rule> rule(new core_api::events::Rule);
+    linked_ptr<api::events::Rule> rule(new api::events::Rule);
     rule->id.reset(new std::string(kRuleId1));
     rule->priority.reset(new int(100));
     rule->actions.push_back(linked_ptr<base::Value>(action_dict.DeepCopy()));
@@ -133,14 +133,14 @@
   }
 
   // Returns a rule that matches anything and cancels it.
-  linked_ptr<core_api::events::Rule> CreateRule2() {
+  linked_ptr<api::events::Rule> CreateRule2() {
     base::DictionaryValue condition_dict;
     condition_dict.SetString(keys::kInstanceTypeKey, keys::kRequestMatcherType);
 
     base::DictionaryValue action_dict;
     action_dict.SetString(keys::kInstanceTypeKey, keys::kCancelRequestType);
 
-    linked_ptr<core_api::events::Rule> rule(new core_api::events::Rule);
+    linked_ptr<api::events::Rule> rule(new api::events::Rule);
     rule->id.reset(new std::string(kRuleId2));
     rule->priority.reset(new int(100));
     rule->actions.push_back(linked_ptr<base::Value>(action_dict.DeepCopy()));
@@ -149,7 +149,7 @@
     return rule;
   }
 
-  linked_ptr<core_api::events::Rule> CreateRedirectRule(
+  linked_ptr<api::events::Rule> CreateRedirectRule(
       const std::string& destination) {
     base::DictionaryValue condition_dict;
     condition_dict.SetString(keys::kInstanceTypeKey, keys::kRequestMatcherType);
@@ -158,7 +158,7 @@
     action_dict.SetString(keys::kInstanceTypeKey, keys::kRedirectRequestType);
     action_dict.SetString(keys::kRedirectUrlKey, destination);
 
-    linked_ptr<core_api::events::Rule> rule(new core_api::events::Rule);
+    linked_ptr<api::events::Rule> rule(new api::events::Rule);
     rule->id.reset(new std::string(kRuleId3));
     rule->priority.reset(new int(100));
     rule->actions.push_back(linked_ptr<base::Value>(action_dict.DeepCopy()));
@@ -169,7 +169,7 @@
 
   // Create a rule to ignore all other rules for a destination that
   // contains index.html.
-  linked_ptr<core_api::events::Rule> CreateIgnoreRule() {
+  linked_ptr<api::events::Rule> CreateIgnoreRule() {
     base::DictionaryValue condition_dict;
     base::DictionaryValue* http_condition_dict = new base::DictionaryValue();
     http_condition_dict->SetString(keys2::kPathContainsKey, "index.html");
@@ -180,7 +180,7 @@
     action_dict.SetString(keys::kInstanceTypeKey, keys::kIgnoreRulesType);
     action_dict.SetInteger(keys::kLowerPriorityThanKey, 150);
 
-    linked_ptr<core_api::events::Rule> rule(new core_api::events::Rule);
+    linked_ptr<api::events::Rule> rule(new api::events::Rule);
     rule->id.reset(new std::string(kRuleId4));
     rule->priority.reset(new int(200));
     rule->actions.push_back(linked_ptr<base::Value>(action_dict.DeepCopy()));
@@ -205,13 +205,13 @@
   // Create a rule with the ID |rule_id| and with conditions created from the
   // |attributes| specified (one entry one condition). An example value of a
   // string from |attributes| is: "\"resourceType\": [\"stylesheet\"], \n".
-  linked_ptr<core_api::events::Rule> CreateCancellingRule(
+  linked_ptr<api::events::Rule> CreateCancellingRule(
       const char* rule_id,
       const std::vector<const std::string*>& attributes) {
     base::DictionaryValue action_dict;
     action_dict.SetString(keys::kInstanceTypeKey, keys::kCancelRequestType);
 
-    linked_ptr<core_api::events::Rule> rule(new core_api::events::Rule);
+    linked_ptr<api::events::Rule> rule(new api::events::Rule);
     rule->id.reset(new std::string(rule_id));
     rule->priority.reset(new int(1));
     rule->actions.push_back(linked_ptr<base::Value>(action_dict.DeepCopy()));
@@ -270,7 +270,7 @@
       new TestWebRequestRulesRegistry(extension_info_map_));
   std::string error;
 
-  std::vector<linked_ptr<core_api::events::Rule>> rules;
+  std::vector<linked_ptr<api::events::Rule>> rules;
   rules.push_back(CreateRule1());
   rules.push_back(CreateRule2());
 
@@ -312,7 +312,7 @@
   std::string error;
 
   // Setup RulesRegistry to contain two rules.
-  std::vector<linked_ptr<core_api::events::Rule>> rules_to_add;
+  std::vector<linked_ptr<api::events::Rule>> rules_to_add;
   rules_to_add.push_back(CreateRule1());
   rules_to_add.push_back(CreateRule2());
   error = registry->AddRules(kExtensionId, rules_to_add);
@@ -320,7 +320,7 @@
   EXPECT_EQ(1, registry->num_clear_cache_calls());
 
   // Verify initial state.
-  std::vector<linked_ptr<core_api::events::Rule>> registered_rules;
+  std::vector<linked_ptr<api::events::Rule>> registered_rules;
   registry->GetAllRules(kExtensionId, &registered_rules);
   EXPECT_EQ(2u, registered_rules.size());
   EXPECT_EQ(1u, registry->RulesWithoutTriggers());
@@ -360,7 +360,7 @@
   std::string error;
 
   // Setup RulesRegistry to contain two rules, one for each extension.
-  std::vector<linked_ptr<core_api::events::Rule>> rules_to_add(1);
+  std::vector<linked_ptr<api::events::Rule>> rules_to_add(1);
   rules_to_add[0] = CreateRule1();
   error = registry->AddRules(kExtensionId, rules_to_add);
   EXPECT_EQ("", error);
@@ -372,7 +372,7 @@
   EXPECT_EQ(2, registry->num_clear_cache_calls());
 
   // Verify initial state.
-  std::vector<linked_ptr<core_api::events::Rule>> registered_rules;
+  std::vector<linked_ptr<api::events::Rule>> registered_rules;
   registry->GetAllRules(kExtensionId, &registered_rules);
   EXPECT_EQ(1u, registered_rules.size());
   registered_rules.clear();
@@ -411,12 +411,12 @@
       new TestWebRequestRulesRegistry(extension_info_map_));
   std::string error;
 
-  std::vector<linked_ptr<core_api::events::Rule>> rules_to_add_1(1);
+  std::vector<linked_ptr<api::events::Rule>> rules_to_add_1(1);
   rules_to_add_1[0] = CreateRedirectRule("http://www.foo.com");
   error = registry->AddRules(kExtensionId, rules_to_add_1);
   EXPECT_EQ("", error);
 
-  std::vector<linked_ptr<core_api::events::Rule>> rules_to_add_2(1);
+  std::vector<linked_ptr<api::events::Rule>> rules_to_add_2(1);
   rules_to_add_2[0] = CreateRedirectRule("http://www.bar.com");
   error = registry->AddRules(kExtensionId2, rules_to_add_2);
   EXPECT_EQ("", error);
@@ -455,17 +455,17 @@
       new TestWebRequestRulesRegistry(extension_info_map_));
   std::string error;
 
-  std::vector<linked_ptr<core_api::events::Rule>> rules_to_add_1(1);
+  std::vector<linked_ptr<api::events::Rule>> rules_to_add_1(1);
   rules_to_add_1[0] = CreateRedirectRule("http://www.foo.com");
   error = registry->AddRules(kExtensionId, rules_to_add_1);
   EXPECT_EQ("", error);
 
-  std::vector<linked_ptr<core_api::events::Rule>> rules_to_add_2(1);
+  std::vector<linked_ptr<api::events::Rule>> rules_to_add_2(1);
   rules_to_add_2[0] = CreateRedirectRule("http://www.bar.com");
   error = registry->AddRules(kExtensionId2, rules_to_add_2);
   EXPECT_EQ("", error);
 
-  std::vector<linked_ptr<core_api::events::Rule>> rules_to_add_3(1);
+  std::vector<linked_ptr<api::events::Rule>> rules_to_add_3(1);
   rules_to_add_3[0] = CreateIgnoreRule();
   error = registry->AddRules(kExtensionId, rules_to_add_3);
   EXPECT_EQ("", error);
@@ -532,11 +532,11 @@
   scoped_ptr<base::Value> value2 = base::JSONReader::Read(kRule2);
   ASSERT_TRUE(value2.get());
 
-  std::vector<linked_ptr<core_api::events::Rule>> rules;
-  rules.push_back(make_linked_ptr(new core_api::events::Rule));
-  rules.push_back(make_linked_ptr(new core_api::events::Rule));
-  ASSERT_TRUE(core_api::events::Rule::Populate(*value1, rules[0].get()));
-  ASSERT_TRUE(core_api::events::Rule::Populate(*value2, rules[1].get()));
+  std::vector<linked_ptr<api::events::Rule>> rules;
+  rules.push_back(make_linked_ptr(new api::events::Rule));
+  rules.push_back(make_linked_ptr(new api::events::Rule));
+  ASSERT_TRUE(api::events::Rule::Populate(*value1, rules[0].get()));
+  ASSERT_TRUE(api::events::Rule::Populate(*value2, rules[1].get()));
 
   scoped_refptr<WebRequestRulesRegistry> registry(
       new TestWebRequestRulesRegistry(extension_info_map_));
@@ -571,7 +571,7 @@
                                     kNonMatchingNonUrlAttribute);
   std::string error;
   std::vector<const std::string*> attributes;
-  std::vector<linked_ptr<core_api::events::Rule>> rules;
+  std::vector<linked_ptr<api::events::Rule>> rules;
 
   // Rules 1 and 2 have one condition, neither of them should fire.
   attributes.push_back(&kNonMatchingNonUrlAttribute);
@@ -618,7 +618,7 @@
       "\"firstPartyForCookiesUrl\": { \"hostContains\": \"fpfc\" }, \n");
   std::string error;
   std::vector<const std::string*> attributes;
-  std::vector<linked_ptr<core_api::events::Rule>> rules;
+  std::vector<linked_ptr<api::events::Rule>> rules;
 
   // Rule 1 has one condition, with a url attribute
   attributes.push_back(&kUrlAttribute);
@@ -699,8 +699,8 @@
   scoped_ptr<base::Value> value = base::JSONReader::Read(kRule);
   ASSERT_TRUE(value);
 
-  core_api::events::Rule rule;
-  ASSERT_TRUE(core_api::events::Rule::Populate(*value, &rule));
+  api::events::Rule rule;
+  ASSERT_TRUE(api::events::Rule::Populate(*value, &rule));
 
   std::string error;
   URLMatcher matcher;
@@ -789,9 +789,9 @@
   scoped_ptr<base::Value> value = base::JSONReader::Read(kRule);
   ASSERT_TRUE(value.get());
 
-  std::vector<linked_ptr<core_api::events::Rule>> rules;
-  rules.push_back(make_linked_ptr(new core_api::events::Rule));
-  ASSERT_TRUE(core_api::events::Rule::Populate(*value, rules.back().get()));
+  std::vector<linked_ptr<api::events::Rule>> rules;
+  rules.push_back(make_linked_ptr(new api::events::Rule));
+  ASSERT_TRUE(api::events::Rule::Populate(*value, rules.back().get()));
 
   scoped_refptr<WebRequestRulesRegistry> registry(
       new TestWebRequestRulesRegistry(extension_info_map_));
diff --git a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.h b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.h
index e4e6a00..5eb8ef3 100644
--- a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.h
+++ b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.h
@@ -166,7 +166,7 @@
 };
 
 class EasyUnlockPrivateConnectToBluetoothServiceInsecurelyFunction
-    : public core_api::BluetoothSocketAbstractConnectFunction {
+    : public api::BluetoothSocketAbstractConnectFunction {
  public:
   DECLARE_EXTENSION_FUNCTION(
       "easyUnlockPrivate.connectToBluetoothServiceInsecurely",
@@ -328,7 +328,7 @@
 };
 
 class EasyUnlockPrivateGetConnectionInfoFunction
-    : public core_api::BluetoothExtensionFunction {
+    : public api::BluetoothExtensionFunction {
  public:
   DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.getConnectionInfo",
                              EASYUNLOCKPRIVATE_GETCONNECTIONINFO)
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc
index 7bc876ae..0325f4f 100644
--- a/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc
+++ b/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc
@@ -152,10 +152,10 @@
     if (fail_)
       return result.Pass();
     result.reset(new DeviceStateList);
-    scoped_ptr<core_api::networking_private::DeviceStateProperties> properties(
-        new core_api::networking_private::DeviceStateProperties);
-    properties->type = core_api::networking_private::NETWORK_TYPE_ETHERNET;
-    properties->state = core_api::networking_private::DEVICE_STATE_TYPE_ENABLED;
+    scoped_ptr<api::networking_private::DeviceStateProperties> properties(
+        new api::networking_private::DeviceStateProperties);
+    properties->type = api::networking_private::NETWORK_TYPE_ETHERNET;
+    properties->state = api::networking_private::DEVICE_STATE_TYPE_ENABLED;
     result->push_back(properties.Pass());
     return result.Pass();
   }
diff --git a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc
index 1652078f..8a61cde8 100644
--- a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc
+++ b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc
@@ -37,7 +37,7 @@
 using extensions::ExtensionSystem;
 using extensions::ExtensionUpdater;
 
-using extensions::core_api::runtime::PlatformInfo;
+using extensions::api::runtime::PlatformInfo;
 
 namespace {
 
@@ -183,15 +183,15 @@
 bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) {
   const char* os = update_client::UpdateQueryParams::GetOS();
   if (strcmp(os, "mac") == 0) {
-    info->os = extensions::core_api::runtime::PLATFORM_OS_MAC;
+    info->os = extensions::api::runtime::PLATFORM_OS_MAC;
   } else if (strcmp(os, "win") == 0) {
-    info->os = extensions::core_api::runtime::PLATFORM_OS_WIN;
+    info->os = extensions::api::runtime::PLATFORM_OS_WIN;
   } else if (strcmp(os, "cros") == 0) {
-    info->os = extensions::core_api::runtime::PLATFORM_OS_CROS;
+    info->os = extensions::api::runtime::PLATFORM_OS_CROS;
   } else if (strcmp(os, "linux") == 0) {
-    info->os = extensions::core_api::runtime::PLATFORM_OS_LINUX;
+    info->os = extensions::api::runtime::PLATFORM_OS_LINUX;
   } else if (strcmp(os, "openbsd") == 0) {
-    info->os = extensions::core_api::runtime::PLATFORM_OS_OPENBSD;
+    info->os = extensions::api::runtime::PLATFORM_OS_OPENBSD;
   } else {
     NOTREACHED();
     return false;
@@ -199,11 +199,11 @@
 
   const char* arch = update_client::UpdateQueryParams::GetArch();
   if (strcmp(arch, "arm") == 0) {
-    info->arch = extensions::core_api::runtime::PLATFORM_ARCH_ARM;
+    info->arch = extensions::api::runtime::PLATFORM_ARCH_ARM;
   } else if (strcmp(arch, "x86") == 0) {
-    info->arch = extensions::core_api::runtime::PLATFORM_ARCH_X86_32;
+    info->arch = extensions::api::runtime::PLATFORM_ARCH_X86_32;
   } else if (strcmp(arch, "x64") == 0) {
-    info->arch = extensions::core_api::runtime::PLATFORM_ARCH_X86_64;
+    info->arch = extensions::api::runtime::PLATFORM_ARCH_X86_64;
   } else {
     NOTREACHED();
     return false;
@@ -211,14 +211,11 @@
 
   const char* nacl_arch = update_client::UpdateQueryParams::GetNaclArch();
   if (strcmp(nacl_arch, "arm") == 0) {
-    info->nacl_arch =
-        extensions::core_api::runtime::PLATFORM_NACL_ARCH_ARM;
+    info->nacl_arch = extensions::api::runtime::PLATFORM_NACL_ARCH_ARM;
   } else if (strcmp(nacl_arch, "x86-32") == 0) {
-    info->nacl_arch =
-        extensions::core_api::runtime::PLATFORM_NACL_ARCH_X86_32;
+    info->nacl_arch = extensions::api::runtime::PLATFORM_NACL_ARCH_X86_32;
   } else if (strcmp(nacl_arch, "x86-64") == 0) {
-    info->nacl_arch =
-        extensions::core_api::runtime::PLATFORM_NACL_ARCH_X86_64;
+    info->nacl_arch = extensions::api::runtime::PLATFORM_NACL_ARCH_X86_64;
   } else {
     NOTREACHED();
     return false;
diff --git a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h
index 952a0fd..934bcd8 100644
--- a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h
+++ b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h
@@ -47,8 +47,7 @@
   bool CheckForUpdates(const std::string& extension_id,
                        const UpdateCheckCallback& callback) override;
   void OpenURL(const GURL& uninstall_url) override;
-  bool GetPlatformInfo(
-      extensions::core_api::runtime::PlatformInfo* info) override;
+  bool GetPlatformInfo(extensions::api::runtime::PlatformInfo* info) override;
   bool RestartDevice(std::string* error_message) override;
   bool OpenOptionsPage(const extensions::Extension* extension) override;
 
diff --git a/chrome/browser/extensions/api/sockets_tcp_server/sockets_tcp_server_api_unittest.cc b/chrome/browser/extensions/api/sockets_tcp_server/sockets_tcp_server_api_unittest.cc
index a18abba3..2b2a8fa 100644
--- a/chrome/browser/extensions/api/sockets_tcp_server/sockets_tcp_server_api_unittest.cc
+++ b/chrome/browser/extensions/api/sockets_tcp_server/sockets_tcp_server_api_unittest.cc
@@ -17,7 +17,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace extensions {
-namespace core_api {
+namespace api {
 
 static scoped_ptr<KeyedService> ApiResourceManagerTestFactory(
     content::BrowserContext* context) {
@@ -66,5 +66,5 @@
   ASSERT_TRUE(result.get());
 }
 
-}  // namespace core_api
+}  // namespace api
 }  // namespace extensions
diff --git a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
index 3def5bb2..b6b1272 100644
--- a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
+++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
@@ -43,7 +43,7 @@
 namespace extensions {
 class ExtensionRegistry;
 
-namespace storage = core_api::storage;
+namespace storage = api::storage;
 
 namespace {
 
diff --git a/chrome/browser/extensions/api/storage/sync_value_store_cache.cc b/chrome/browser/extensions/api/storage/sync_value_store_cache.cc
index c8fe8ed2..25dc33a 100644
--- a/chrome/browser/extensions/api/storage/sync_value_store_cache.cc
+++ b/chrome/browser/extensions/api/storage/sync_value_store_cache.cc
@@ -27,10 +27,9 @@
 // extensions/common/api/storage.json.
 SettingsStorageQuotaEnforcer::Limits GetSyncQuotaLimits() {
   SettingsStorageQuotaEnforcer::Limits limits = {
-    static_cast<size_t>(core_api::storage::sync::QUOTA_BYTES),
-    static_cast<size_t>(core_api::storage::sync::QUOTA_BYTES_PER_ITEM),
-    static_cast<size_t>(core_api::storage::sync::MAX_ITEMS)
-  };
+      static_cast<size_t>(api::storage::sync::QUOTA_BYTES),
+      static_cast<size_t>(api::storage::sync::QUOTA_BYTES_PER_ITEM),
+      static_cast<size_t>(api::storage::sync::MAX_ITEMS)};
   return limits;
 }
 
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
index 4f658dd..db443e5 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -112,7 +112,7 @@
 namespace keys = tabs_constants;
 namespace tabs = api::tabs;
 
-using core_api::extension_types::InjectDetails;
+using api::extension_types::InjectDetails;
 
 namespace {
 
diff --git a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
index f201cee..5edf968 100644
--- a/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
+++ b/chrome/browser/extensions/api/virtual_keyboard_private/chrome_virtual_keyboard_delegate.cc
@@ -23,7 +23,7 @@
 #include "ui/keyboard/keyboard_switches.h"
 #include "ui/keyboard/keyboard_util.h"
 
-namespace keyboard_api = extensions::core_api::virtual_keyboard_private;
+namespace keyboard_api = extensions::api::virtual_keyboard_private;
 
 namespace {
 
diff --git a/chrome/browser/extensions/api/vpn_provider/vpn_provider_apitest.cc b/chrome/browser/extensions/api/vpn_provider/vpn_provider_apitest.cc
index 1ffe99e..af94b975 100644
--- a/chrome/browser/extensions/api/vpn_provider/vpn_provider_apitest.cc
+++ b/chrome/browser/extensions/api/vpn_provider/vpn_provider_apitest.cc
@@ -31,7 +31,7 @@
 
 namespace {
 
-namespace api_vpn = extensions::core_api::vpn_provider;
+namespace api_vpn = extensions::api::vpn_provider;
 
 const char kNetworkProfilePath[] = "/network/test";
 const char kTestConfig[] = "testconfig";
diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
index ef18ad3..b239c63 100644
--- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
@@ -57,7 +57,7 @@
 
 namespace helpers = extension_web_request_api_helpers;
 namespace keys = extension_web_request_api_constants;
-namespace web_request = extensions::core_api::web_request;
+namespace web_request = extensions::api::web_request;
 
 using base::BinaryValue;
 using base::DictionaryValue;
diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc
index d6d27c2..1dc12991 100644
--- a/chrome/browser/extensions/chrome_extensions_browser_client.cc
+++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc
@@ -128,7 +128,7 @@
 }
 
 bool ChromeExtensionsBrowserClient::CanExtensionCrossIncognito(
-    const extensions::Extension* extension,
+    const Extension* extension,
     content::BrowserContext* context) const {
   return IsGuestSession(context)
       || util::CanCrossIncognito(extension, context);
@@ -243,23 +243,20 @@
 void ChromeExtensionsBrowserClient::RegisterExtensionFunctions(
     ExtensionFunctionRegistry* registry) const {
   // Preferences.
-  registry->RegisterFunction<extensions::GetPreferenceFunction>();
-  registry->RegisterFunction<extensions::SetPreferenceFunction>();
-  registry->RegisterFunction<extensions::ClearPreferenceFunction>();
+  registry->RegisterFunction<GetPreferenceFunction>();
+  registry->RegisterFunction<SetPreferenceFunction>();
+  registry->RegisterFunction<ClearPreferenceFunction>();
 
   // Direct Preference Access for Component Extensions.
-  registry->RegisterFunction<
-      extensions::chromedirectsetting::GetDirectSettingFunction>();
-  registry->RegisterFunction<
-      extensions::chromedirectsetting::SetDirectSettingFunction>();
-  registry->RegisterFunction<
-      extensions::chromedirectsetting::ClearDirectSettingFunction>();
+  registry->RegisterFunction<chromedirectsetting::GetDirectSettingFunction>();
+  registry->RegisterFunction<chromedirectsetting::SetDirectSettingFunction>();
+  registry->RegisterFunction<chromedirectsetting::ClearDirectSettingFunction>();
 
   // Generated APIs from lower-level modules.
-  extensions::core_api::GeneratedFunctionRegistry::RegisterAll(registry);
+  api::GeneratedFunctionRegistry::RegisterAll(registry);
 
   // Generated APIs from Chrome.
-  extensions::api::GeneratedFunctionRegistry::RegisterAll(registry);
+  api::ChromeGeneratedFunctionRegistry::RegisterAll(registry);
 }
 
 void ChromeExtensionsBrowserClient::RegisterMojoServices(
@@ -269,11 +266,10 @@
   RegisterChromeServicesForFrame(render_frame_host, extension);
 }
 
-scoped_ptr<extensions::RuntimeAPIDelegate>
+scoped_ptr<RuntimeAPIDelegate>
 ChromeExtensionsBrowserClient::CreateRuntimeAPIDelegate(
     content::BrowserContext* context) const {
-  return scoped_ptr<extensions::RuntimeAPIDelegate>(
-      new ChromeRuntimeAPIDelegate(context));
+  return scoped_ptr<RuntimeAPIDelegate>(new ChromeRuntimeAPIDelegate(context));
 }
 
 const ComponentExtensionResourceManager*
@@ -332,7 +328,7 @@
 void ChromeExtensionsBrowserClient::ReportError(
     content::BrowserContext* context,
     scoped_ptr<ExtensionError> error) {
-  extensions::ErrorConsole::Get(context)->ReportError(error.Pass());
+  ErrorConsole::Get(context)->ReportError(error.Pass());
 }
 
 void ChromeExtensionsBrowserClient::CleanUpWebView(int embedder_process_id,
diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.h b/chrome/browser/extensions/chrome_extensions_browser_client.h
index b47d3e9..b59acbd 100644
--- a/chrome/browser/extensions/chrome_extensions_browser_client.h
+++ b/chrome/browser/extensions/chrome_extensions_browser_client.h
@@ -29,7 +29,7 @@
 class ChromeProcessManagerDelegate;
 class ContentSettingsPrefsObserver;
 
-// Implementation of extensions::BrowserClient for Chrome, which includes
+// Implementation of BrowserClient for Chrome, which includes
 // knowledge of Profiles, BrowserContexts and incognito.
 //
 // NOTE: Methods that do not require knowledge of browser concepts should be
@@ -61,7 +61,7 @@
       const std::string& extension_id,
       content::BrowserContext* context) const override;
   bool CanExtensionCrossIncognito(
-      const extensions::Extension* extension,
+      const Extension* extension,
       content::BrowserContext* context) const override;
   net::URLRequestJob* MaybeCreateResourceBundleRequestJob(
       net::URLRequest* request,
@@ -91,7 +91,7 @@
       ExtensionFunctionRegistry* registry) const override;
   void RegisterMojoServices(content::RenderFrameHost* render_frame_host,
                             const Extension* extension) const override;
-  scoped_ptr<extensions::RuntimeAPIDelegate> CreateRuntimeAPIDelegate(
+  scoped_ptr<RuntimeAPIDelegate> CreateRuntimeAPIDelegate(
       content::BrowserContext* context) const override;
   const ComponentExtensionResourceManager*
   GetComponentExtensionResourceManager() override;
diff --git a/chrome/browser/extensions/display_info_provider_aura.cc b/chrome/browser/extensions/display_info_provider_aura.cc
index 0d15906..65c2823 100644
--- a/chrome/browser/extensions/display_info_provider_aura.cc
+++ b/chrome/browser/extensions/display_info_provider_aura.cc
@@ -16,7 +16,7 @@
 
 bool DisplayInfoProviderAura::SetInfo(
     const std::string& display_id,
-    const core_api::system_display::DisplayProperties& info,
+    const api::system_display::DisplayProperties& info,
     std::string* error) {
   *error = "Not implemented";
   return false;
@@ -24,7 +24,7 @@
 
 void DisplayInfoProviderAura::UpdateDisplayUnitInfoForPlatform(
     const gfx::Display& display,
-    extensions::core_api::system_display::DisplayUnitInfo* unit) {
+    extensions::api::system_display::DisplayUnitInfo* unit) {
   static bool logged_once = false;
   if (!logged_once) {
     NOTIMPLEMENTED();
diff --git a/chrome/browser/extensions/display_info_provider_aura.h b/chrome/browser/extensions/display_info_provider_aura.h
index 7456283..ad44dd6 100644
--- a/chrome/browser/extensions/display_info_provider_aura.h
+++ b/chrome/browser/extensions/display_info_provider_aura.h
@@ -16,11 +16,11 @@
 
   // DisplayInfoProvider implementation.
   bool SetInfo(const std::string& display_id,
-               const core_api::system_display::DisplayProperties& info,
+               const api::system_display::DisplayProperties& info,
                std::string* error) override;
   void UpdateDisplayUnitInfoForPlatform(
       const gfx::Display& display,
-      core_api::system_display::DisplayUnitInfo* unit) override;
+      api::system_display::DisplayUnitInfo* unit) override;
   gfx::Screen* GetActiveScreen() override;
 
  private:
diff --git a/chrome/browser/extensions/display_info_provider_chromeos.cc b/chrome/browser/extensions/display_info_provider_chromeos.cc
index 687c4182..3521971 100644
--- a/chrome/browser/extensions/display_info_provider_chromeos.cc
+++ b/chrome/browser/extensions/display_info_provider_chromeos.cc
@@ -17,10 +17,10 @@
 
 namespace extensions {
 
-using core_api::system_display::Bounds;
-using core_api::system_display::DisplayUnitInfo;
-using core_api::system_display::DisplayProperties;
-using core_api::system_display::Insets;
+using api::system_display::Bounds;
+using api::system_display::DisplayUnitInfo;
+using api::system_display::DisplayProperties;
+using api::system_display::Insets;
 
 namespace {
 
@@ -357,7 +357,7 @@
 
 void DisplayInfoProviderChromeOS::UpdateDisplayUnitInfoForPlatform(
     const gfx::Display& display,
-    extensions::core_api::system_display::DisplayUnitInfo* unit) {
+    extensions::api::system_display::DisplayUnitInfo* unit) {
   ash::DisplayManager* display_manager =
       ash::Shell::GetInstance()->display_manager();
   unit->name = display_manager->GetDisplayNameForId(display.id());
diff --git a/chrome/browser/extensions/display_info_provider_chromeos.h b/chrome/browser/extensions/display_info_provider_chromeos.h
index 9424d8e..f403726 100644
--- a/chrome/browser/extensions/display_info_provider_chromeos.h
+++ b/chrome/browser/extensions/display_info_provider_chromeos.h
@@ -16,11 +16,11 @@
 
   // DisplayInfoProvider implementation.
   bool SetInfo(const std::string& display_id,
-               const core_api::system_display::DisplayProperties& info,
+               const api::system_display::DisplayProperties& info,
                std::string* error) override;
   void UpdateDisplayUnitInfoForPlatform(
       const gfx::Display& display,
-      core_api::system_display::DisplayUnitInfo* unit) override;
+      api::system_display::DisplayUnitInfo* unit) override;
   gfx::Screen* GetActiveScreen() override;
 
  private:
diff --git a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc
index a6c968b..4429bfa 100644
--- a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc
+++ b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc
@@ -38,7 +38,7 @@
  protected:
   void CallSetDisplayUnitInfo(
       const std::string& display_id,
-      const core_api::system_display::DisplayProperties& info,
+      const api::system_display::DisplayProperties& info,
       bool* success,
       std::string* error) {
     // Reset error messsage.
@@ -61,14 +61,14 @@
   }
 
   std::string SystemInfoDisplayInsetsToString(
-      const core_api::system_display::Insets& insets) const {
+      const api::system_display::Insets& insets) const {
     // Order to match gfx::Insets::ToString().
     return base::StringPrintf(
         "%d,%d,%d,%d", insets.top, insets.left, insets.bottom, insets.right);
   }
 
   std::string SystemInfoDisplayBoundsToString(
-      const core_api::system_display::Bounds& bounds) const {
+      const api::system_display::Bounds& bounds) const {
     // Order to match gfx::Rect::ToString().
     return base::StringPrintf(
         "%d,%d %dx%d", bounds.left, bounds.top, bounds.width, bounds.height);
@@ -328,7 +328,7 @@
   UpdateDisplay("1200x600,520x400");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(-520));
   info.bounds_origin_y.reset(new int(50));
 
@@ -347,7 +347,7 @@
   UpdateDisplay("1200x600,520x400");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(1200));
   info.bounds_origin_y.reset(new int(100));
 
@@ -366,7 +366,7 @@
   UpdateDisplay("1200x600,520x400");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(1100));
   info.bounds_origin_y.reset(new int(-400));
 
@@ -385,7 +385,7 @@
   UpdateDisplay("1200x600,520x400");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(-350));
   info.bounds_origin_y.reset(new int(600));
 
@@ -404,7 +404,7 @@
   UpdateDisplay("1200x600,520x400");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(340));
   info.bounds_origin_y.reset(new int(100));
 
@@ -423,7 +423,7 @@
   UpdateDisplay("1200x600,520x400");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(-1040));
   info.bounds_origin_y.reset(new int(100));
 
@@ -442,7 +442,7 @@
   UpdateDisplay("1200x600,520x400");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(-360));
   info.bounds_origin_y.reset(new int(-301));
 
@@ -462,7 +462,7 @@
   UpdateDisplay("1200x600,1000x100");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(-650));
   info.bounds_origin_y.reset(new int(700));
 
@@ -481,7 +481,7 @@
   UpdateDisplay("1200x600,1000x100");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(850));
   info.bounds_origin_y.reset(new int(-150));
 
@@ -500,7 +500,7 @@
   UpdateDisplay("1200x600,1000x100/l");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(-150));
   info.bounds_origin_y.reset(new int(-650));
 
@@ -520,7 +520,7 @@
   UpdateDisplay("1200x600,1000x100/l");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(1350));
   info.bounds_origin_y.reset(new int(450));
 
@@ -539,7 +539,7 @@
   UpdateDisplay("1200x600*2,500x500");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(250));
   info.bounds_origin_y.reset(new int(-100));
 
@@ -558,7 +558,7 @@
   UpdateDisplay("1200x600,600x1000*2");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(450));
   info.bounds_origin_y.reset(new int(-100));
 
@@ -577,7 +577,7 @@
   UpdateDisplay("1200x600,600x1000*2");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(0x200001));
   info.bounds_origin_y.reset(new int(-100));
 
@@ -596,7 +596,7 @@
   UpdateDisplay("1200x600,600x1000*2");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(300));
   info.bounds_origin_y.reset(new int(-0x200001));
 
@@ -615,7 +615,7 @@
   UpdateDisplay("1200x4600,600x1000*2");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(200000));
   info.bounds_origin_y.reset(new int(10));
 
@@ -634,7 +634,7 @@
   UpdateDisplay("1200x600,600x1000*2");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(300));
   info.is_primary.reset(new bool(true));
 
@@ -658,7 +658,7 @@
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
   const gfx::Display& primary = ash::Shell::GetScreen()->GetPrimaryDisplay();
 
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.bounds_origin_x.reset(new int(300));
   info.mirroring_source_id.reset(
       new std::string(base::Int64ToString(primary.id())));
@@ -677,7 +677,7 @@
   UpdateDisplay("1200x600,600x1000*2");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.rotation.reset(new int(90));
 
   bool success = false;
@@ -731,7 +731,7 @@
 TEST_F(DisplayInfoProviderChromeosTest, SetRotationBeforeMaximizeMode) {
   ash::ScreenOrientationController* screen_orientation_controller =
       ash::Shell::GetInstance()->screen_orientation_controller();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.rotation.reset(new int(90));
 
   bool success = false;
@@ -775,7 +775,7 @@
                    ->screen_orientation_controller()
                    ->rotation_locked());
 
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.rotation.reset(new int(90));
 
   bool success = false;
@@ -794,7 +794,7 @@
   UpdateDisplay("1200x600,600x1000*2");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
+  api::system_display::DisplayProperties info;
   info.rotation.reset(new int(91));
 
   bool success = false;
@@ -810,8 +810,8 @@
   UpdateDisplay("1200x600,600x1000*2");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
-  info.overscan.reset(new core_api::system_display::Insets);
+  api::system_display::DisplayProperties info;
+  info.overscan.reset(new api::system_display::Insets);
   info.overscan->left = -10;
 
   bool success = false;
@@ -873,8 +873,8 @@
   UpdateDisplay("1200x600,600x1000*2");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
-  info.overscan.reset(new core_api::system_display::Insets);
+  api::system_display::DisplayProperties info;
+  info.overscan.reset(new api::system_display::Insets);
   // Horizontal overscan is 151, which would make the bounds width 149.
   info.overscan->left = 50;
   info.overscan->top = 10;
@@ -895,8 +895,8 @@
   UpdateDisplay("1200x600,600x1000");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
-  info.overscan.reset(new core_api::system_display::Insets);
+  api::system_display::DisplayProperties info;
+  info.overscan.reset(new api::system_display::Insets);
   // Vertical overscan is 501, which would make the bounds height 499.
   info.overscan->left = 20;
   info.overscan->top = 250;
@@ -916,8 +916,8 @@
   UpdateDisplay("1200x600,600x1000*2");
 
   const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
-  core_api::system_display::DisplayProperties info;
-  info.overscan.reset(new core_api::system_display::Insets);
+  api::system_display::DisplayProperties info;
+  info.overscan.reset(new api::system_display::Insets);
   info.overscan->left = 20;
   info.overscan->top = 199;
   info.overscan->right = 130;
@@ -947,8 +947,8 @@
       ash::test::DisplayManagerTestApi(GetDisplayManager())
           .SetFirstDisplayAsInternalDisplay();
 
-  core_api::system_display::DisplayProperties info;
-  info.overscan.reset(new core_api::system_display::Insets);
+  api::system_display::DisplayProperties info;
+  info.overscan.reset(new api::system_display::Insets);
   // Vertical overscan is 501, which would make the bounds height 499.
   info.overscan->left = 20;
   info.overscan->top = 20;
diff --git a/chrome/browser/extensions/display_info_provider_mac.cc b/chrome/browser/extensions/display_info_provider_mac.cc
index 0991c774..c49c3f1 100644
--- a/chrome/browser/extensions/display_info_provider_mac.cc
+++ b/chrome/browser/extensions/display_info_provider_mac.cc
@@ -16,7 +16,7 @@
 
 bool DisplayInfoProviderMac::SetInfo(
     const std::string& display_id,
-    const core_api::system_display::DisplayProperties& info,
+    const api::system_display::DisplayProperties& info,
     std::string* error) {
   *error = "Not implemented";
   return false;
@@ -24,7 +24,7 @@
 
 void DisplayInfoProviderMac::UpdateDisplayUnitInfoForPlatform(
     const gfx::Display& display,
-    extensions::core_api::system_display::DisplayUnitInfo* unit) {
+    extensions::api::system_display::DisplayUnitInfo* unit) {
   static bool logged_once = false;
   if (!logged_once) {
     NOTIMPLEMENTED();
diff --git a/chrome/browser/extensions/display_info_provider_mac.h b/chrome/browser/extensions/display_info_provider_mac.h
index 6795ef94..a83d60af 100644
--- a/chrome/browser/extensions/display_info_provider_mac.h
+++ b/chrome/browser/extensions/display_info_provider_mac.h
@@ -16,11 +16,11 @@
 
   // DisplayInfoProvider implementation.
   bool SetInfo(const std::string& display_id,
-               const core_api::system_display::DisplayProperties& info,
+               const api::system_display::DisplayProperties& info,
                std::string* error) override;
   void UpdateDisplayUnitInfoForPlatform(
       const gfx::Display& display,
-      core_api::system_display::DisplayUnitInfo* unit) override;
+      api::system_display::DisplayUnitInfo* unit) override;
   gfx::Screen* GetActiveScreen() override;
 
  private:
diff --git a/chrome/browser/extensions/display_info_provider_win.cc b/chrome/browser/extensions/display_info_provider_win.cc
index 7d04411..8ddfbc0 100644
--- a/chrome/browser/extensions/display_info_provider_win.cc
+++ b/chrome/browser/extensions/display_info_provider_win.cc
@@ -17,7 +17,7 @@
 
 namespace extensions {
 
-using core_api::system_display::DisplayUnitInfo;
+using api::system_display::DisplayUnitInfo;
 
 namespace {
 
@@ -59,7 +59,7 @@
 
 bool DisplayInfoProviderWin::SetInfo(
     const std::string& display_id,
-    const core_api::system_display::DisplayProperties& info,
+    const api::system_display::DisplayProperties& info,
     std::string* error) {
   *error = "Not implemented";
   return false;
@@ -67,7 +67,7 @@
 
 void DisplayInfoProviderWin::UpdateDisplayUnitInfoForPlatform(
     const gfx::Display& display,
-    extensions::core_api::system_display::DisplayUnitInfo* unit) {
+    extensions::api::system_display::DisplayUnitInfo* unit) {
   DisplayInfo all_displays;
   EnumDisplayMonitors(
       NULL, NULL, EnumMonitorCallback, reinterpret_cast<LPARAM>(&all_displays));
diff --git a/chrome/browser/extensions/display_info_provider_win.h b/chrome/browser/extensions/display_info_provider_win.h
index 9db5fff..3976fb2d 100644
--- a/chrome/browser/extensions/display_info_provider_win.h
+++ b/chrome/browser/extensions/display_info_provider_win.h
@@ -16,11 +16,11 @@
 
   // DisplayInfoProvider implementation.
   bool SetInfo(const std::string& display_id,
-               const core_api::system_display::DisplayProperties& info,
+               const api::system_display::DisplayProperties& info,
                std::string* error) override;
   void UpdateDisplayUnitInfoForPlatform(
       const gfx::Display& display,
-      core_api::system_display::DisplayUnitInfo* unit) override;
+      api::system_display::DisplayUnitInfo* unit) override;
   gfx::Screen* GetActiveScreen() override;
 
  private:
diff --git a/chrome/browser/extensions/extension_webui_apitest.cc b/chrome/browser/extensions/extension_webui_apitest.cc
index 13f5b79..90c4555a 100644
--- a/chrome/browser/extensions/extension_webui_apitest.cc
+++ b/chrome/browser/extensions/extension_webui_apitest.cc
@@ -22,7 +22,7 @@
 
 namespace extensions {
 
-namespace OnMessage = core_api::test::OnMessage;
+namespace OnMessage = api::test::OnMessage;
 
 namespace {