summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-02 05:46:23 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-02 05:46:23 +0000
commitbe78005c77e886ea03309074d4b7065427d2b9de (patch)
treed733a3df1c83febb818d6326c8335d7162e7b5c7
parent0a0e32150f1f3bfce3d0ecd082da4a6f11b0101f (diff)
downloadchromium_src-be78005c77e886ea03309074d4b7065427d2b9de.zip
chromium_src-be78005c77e886ea03309074d4b7065427d2b9de.tar.gz
chromium_src-be78005c77e886ea03309074d4b7065427d2b9de.tar.bz2
ifdef a few pieces of extensions code.
BUG=349436 Review URL: https://codereview.chromium.org/420033002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287156 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/geolocation/geolocation_permission_context_unittest.cc10
-rw-r--r--chrome/browser/ui/sync/profile_signin_confirmation_helper.cc15
-rw-r--r--chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc23
3 files changed, 34 insertions, 14 deletions
diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
index b243ce6..a0ebc11 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
@@ -21,7 +21,6 @@
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/geolocation/geolocation_permission_context_factory.h"
#include "chrome/browser/infobars/infobar_service.h"
-#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "components/infobars/core/confirm_infobar_delegate.h"
@@ -34,7 +33,6 @@
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/web_contents_tester.h"
-#include "extensions/browser/view_type_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_ANDROID)
@@ -43,6 +41,10 @@
#include "chrome/common/pref_names.h"
#endif
+#if defined(ENABLE_EXTENSIONS)
+#include "extensions/browser/view_type_utils.h"
+#endif
+
using content::MockRenderProcessHost;
@@ -221,7 +223,9 @@ void GeolocationPermissionContextTests::AddNewTab(const GURL& url) {
SendNavigate(extra_tabs_.size() + 1, url);
// Set up required helpers, and make this be as "tabby" as the code requires.
+#if defined(ENABLE_EXTENSIONS)
extensions::SetViewType(new_tab, extensions::VIEW_TYPE_TAB_CONTENTS);
+#endif
InfoBarService::CreateForWebContents(new_tab);
extra_tabs_.push_back(new_tab);
@@ -247,7 +251,9 @@ void GeolocationPermissionContextTests::SetUp() {
ChromeRenderViewHostTestHarness::SetUp();
// Set up required helpers, and make this be as "tabby" as the code requires.
+#if defined(ENABLE_EXTENSIONS)
extensions::SetViewType(web_contents(), extensions::VIEW_TYPE_TAB_CONTENTS);
+#endif
InfoBarService::CreateForWebContents(web_contents());
TabSpecificContentSettings::CreateForWebContents(web_contents());
#if defined(OS_ANDROID)
diff --git a/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc b/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc
index 580ffad..16fd457 100644
--- a/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc
+++ b/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc
@@ -10,22 +10,25 @@
#include "base/strings/string16.h"
#include "base/task/cancelable_task_tracker.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/history/history_db_task.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/extensions/extension_constants.h"
-#include "chrome/common/extensions/sync_helper.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "content/public/browser/browser_thread.h"
+#include "ui/gfx/color_utils.h"
+#include "ui/native_theme/native_theme.h"
+
+#if defined(ENABLE_EXTENSIONS)
+#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/common/extensions/extension_constants.h"
+#include "chrome/common/extensions/sync_helper.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
-#include "ui/gfx/color_utils.h"
-#include "ui/native_theme/native_theme.h"
+#endif
namespace {
@@ -192,6 +195,7 @@ bool HasBeenShutdown(Profile* profile) {
}
bool HasSyncedExtensions(Profile* profile) {
+#if defined(ENABLE_EXTENSIONS)
extensions::ExtensionSystem* system =
extensions::ExtensionSystem::Get(profile);
if (system && system->extension_service()) {
@@ -211,6 +215,7 @@ bool HasSyncedExtensions(Profile* profile) {
}
}
}
+#endif
return false;
}
diff --git a/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc b/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc
index 6a5dc67..2bed91c 100644
--- a/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc
+++ b/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc
@@ -20,12 +20,9 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/prefs/browser_prefs.h"
-#include "chrome/common/extensions/extension_constants.h"
#include "chrome/test/base/testing_pref_service_syncable.h"
#include "chrome/test/base/testing_profile.h"
#include "components/bookmarks/browser/bookmark_model.h"
@@ -33,10 +30,6 @@
#include "components/pref_registry/pref_registry_syncable.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_utils.h"
-#include "extensions/browser/extension_prefs.h"
-#include "extensions/common/extension.h"
-#include "extensions/common/manifest_constants.h"
-#include "extensions/common/permissions/permission_set.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -46,6 +39,16 @@
#include "chrome/browser/chromeos/settings/device_settings_service.h"
#endif
+#if defined(ENABLE_EXTENSIONS)
+#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/test_extension_system.h"
+#include "chrome/common/extensions/extension_constants.h"
+#include "extensions/browser/extension_prefs.h"
+#include "extensions/common/extension.h"
+#include "extensions/common/manifest_constants.h"
+#include "extensions/common/permissions/permission_set.h"
+#endif
+
namespace {
template<typename T>
@@ -86,6 +89,7 @@ class TestingPrefStoreWithCustomReadError : public TestingPrefStore {
PrefReadError read_error_;
};
+#if defined(ENABLE_EXTENSIONS)
#if defined(OS_WIN)
const base::FilePath::CharType kExtensionFilePath[] =
FILE_PATH_LITERAL("c:\\foo");
@@ -111,6 +115,7 @@ static scoped_refptr<extensions::Extension> CreateExtension(
&error);
return extension;
}
+#endif
} // namespace
@@ -140,6 +145,7 @@ class ProfileSigninConfirmationHelperTest : public testing::Test {
model_ = BookmarkModelFactory::GetForProfile(profile_.get());
test::WaitForBookmarkModelToLoad(model_);
ASSERT_TRUE(profile_->CreateHistoryService(true, false));
+#if defined(ENABLE_EXTENSIONS)
extensions::TestExtensionSystem* system =
static_cast<extensions::TestExtensionSystem*>(
extensions::ExtensionSystem::Get(profile_.get()));
@@ -147,6 +153,7 @@ class ProfileSigninConfirmationHelperTest : public testing::Test {
system->CreateExtensionService(&command_line,
base::FilePath(kExtensionFilePath),
false);
+#endif
}
virtual void TearDown() OVERRIDE {
@@ -193,6 +200,7 @@ TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Bookmarks) {
profile_.get())));
}
+#if defined(ENABLE_EXTENSIONS)
TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Extensions) {
ExtensionService* extensions =
extensions::ExtensionSystem::Get(profile_.get())->extension_service();
@@ -217,6 +225,7 @@ TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Extensions) {
EXPECT_TRUE(GetCallbackResult(
base::Bind(&ui::CheckShouldPromptForNewProfile, profile_.get())));
}
+#endif
// http://crbug.com/393149
TEST_F(ProfileSigninConfirmationHelperTest,