diff options
Diffstat (limited to 'chrome/browser')
40 files changed, 6 insertions, 229 deletions
diff --git a/chrome/browser/automation/automation_profile_impl.h b/chrome/browser/automation/automation_profile_impl.h index b549aca..77401dc 100644 --- a/chrome/browser/automation/automation_profile_impl.h +++ b/chrome/browser/automation/automation_profile_impl.h @@ -174,13 +174,9 @@ class AutomationProfileImpl : public Profile { virtual DesktopNotificationService* GetDesktopNotificationService() { return original_profile_->GetDesktopNotificationService(); } - -#if defined(BROWSER_SYNC) virtual ProfileSyncService* GetProfileSyncService() { return original_profile_->GetProfileSyncService(); } -#endif - virtual bool IsSameProfile(Profile* profile) { return original_profile_->IsSameProfile(profile); } diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 934ba8e..292cea5 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -653,11 +653,9 @@ void Browser::UpdateCommandsForFullscreenMode(bool is_fullscreen) { command_updater_.UpdateCommandEnabled(IDC_REPORT_BUG, show_main_ui); command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_BAR, show_main_ui); command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, show_main_ui); -#if defined(BROWSER_SYNC) command_updater_.UpdateCommandEnabled( IDC_SYNC_BOOKMARKS, show_main_ui && profile_->GetProfileSyncService() != NULL); -#endif command_updater_.UpdateCommandEnabled(IDC_OPTIONS, show_main_ui); command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); @@ -1202,7 +1200,6 @@ void Browser::OpenImportSettingsDialog() { window_->ShowImportDialog(); } -#if defined(BROWSER_SYNC) void Browser::OpenSyncMyBookmarksDialog() { ProfileSyncService* service = profile_->GetProfileSyncService(); // TODO(timsteele): Incognito has no sync service for the time being, @@ -1216,7 +1213,6 @@ void Browser::OpenSyncMyBookmarksDialog() { ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_WRENCH); } } -#endif // defined(BROWSER_SYNC) void Browser::OpenAboutChromeDialog() { UserMetrics::RecordAction(L"AboutChrome", profile_); @@ -1462,9 +1458,7 @@ void Browser::ExecuteCommandWithDisposition( case IDC_SHOW_DOWNLOADS: ShowDownloadsTab(); break; case IDC_SHOW_APP_MENU: ShowAppMenu(); break; case IDC_SHOW_PAGE_MENU: ShowPageMenu(); break; -#if defined(BROWSER_SYNC) case IDC_SYNC_BOOKMARKS: OpenSyncMyBookmarksDialog(); break; -#endif case IDC_OPTIONS: OpenOptionsDialog(); break; case IDC_EDIT_SEARCH_ENGINES: OpenKeywordEditor(); break; case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index 73852e1..c7d91e4 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -401,9 +401,7 @@ class Browser : public TabStripModelDelegate, void OpenOptionsDialog(); void OpenKeywordEditor(); void OpenPasswordManager(); -#if defined(BROWSER_SYNC) void OpenSyncMyBookmarksDialog(); -#endif void OpenImportSettingsDialog(); void OpenAboutChromeDialog(); void OpenHelpTab(); diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 9a9e94b..eb5e3a3 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -61,9 +61,7 @@ #include "third_party/tcmalloc/tcmalloc/src/google/malloc_extension.h" #endif -#if defined(BROWSER_SYNC) using sync_api::SyncManager; -#endif using base::Time; using base::TimeDelta; @@ -469,7 +467,6 @@ std::string AboutVersion(DictionaryValue* localized_strings) { return output; } -#if defined(BROWSER_SYNC) static void AddBoolSyncDetail(ListValue* details, const std::wstring& stat_name, bool stat_value) { DictionaryValue* val = new DictionaryValue; @@ -560,7 +557,6 @@ std::string AboutSync() { return jstemplate_builder::GetTemplateHtml( sync_html, &strings , "t" /* template root node id */); } -#endif // defined(BROWSER_SYNC) // AboutSource ----------------------------------------------------------------- @@ -624,9 +620,7 @@ void AboutSource::StartDataRequest(const std::string& path_raw, } else if (path == kTermsPath) { response = AboutTerms(); } else if (path == kSyncPath) { -#if defined(BROWSER_SYNC) response = AboutSync(); -#endif } FinishDataRequest(response, request_id); diff --git a/chrome/browser/dom_ui/new_tab_page_sync_handler.cc b/chrome/browser/dom_ui/new_tab_page_sync_handler.cc index c792445..3a05ed1 100644 --- a/chrome/browser/dom_ui/new_tab_page_sync_handler.cc +++ b/chrome/browser/dom_ui/new_tab_page_sync_handler.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include "chrome/browser/dom_ui/new_tab_page_sync_handler.h" #include "app/l10n_util.h" @@ -227,5 +225,3 @@ void NewTabPageSyncHandler::SendSyncMessageToPage( } dom_ui_->CallJavascriptFunction(L"syncMessageChanged", value); } - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/dom_ui/new_tab_page_sync_handler.h b/chrome/browser/dom_ui/new_tab_page_sync_handler.h index 3e120ad..cde61da 100644 --- a/chrome/browser/dom_ui/new_tab_page_sync_handler.h +++ b/chrome/browser/dom_ui/new_tab_page_sync_handler.h @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #ifndef CHROME_BROWSER_DOM_UI_NEW_TAB_PAGE_SYNC_HANDLER_H_ #define CHROME_BROWSER_DOM_UI_NEW_TAB_PAGE_SYNC_HANDLER_H_ @@ -68,4 +66,3 @@ class NewTabPageSyncHandler : public DOMMessageHandler, }; #endif // CHROME_BROWSER_DOM_UI_NEW_TAB_PAGE_SYNC_HANDLER_H_ -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index 1e3bfa7..76c44ae 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -561,7 +561,7 @@ NewTabUI::NewTabUI(TabContents* contents) if (WebResourcesEnabled()) AddMessageHandler((new TipsHandler())->Attach(this)); -#if defined(BROWSER_SYNC) && !defined(OS_POSIX) +#if !defined(OS_POSIX) if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync)) { AddMessageHandler((new NewTabPageSyncHandler())->Attach(this)); } diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index 60a372a..752f56c 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -118,10 +118,8 @@ BookmarkBarGtk::BookmarkBarGtk(BrowserWindowGtk* window, model_(NULL), instructions_label_(NULL), instructions_(NULL), -#if defined(BROWSER_SYNC) sync_error_button_(NULL), sync_service_(NULL), -#endif dragged_node_(NULL), toolbar_drop_item_(NULL), theme_provider_(GtkThemeProvider::GetFrom(profile)), @@ -130,14 +128,12 @@ BookmarkBarGtk::BookmarkBarGtk(BrowserWindowGtk* window, floating_(false), last_allocation_width_(-1), event_box_paint_factory_(this) { -#if defined(BROWSER_SYNC) if (profile->GetProfileSyncService()) { // Obtain a pointer to the profile sync service and add our instance as an // observer. sync_service_ = profile->GetProfileSyncService(); sync_service_->AddObserver(this); } -#endif Init(profile); SetProfile(profile); @@ -157,10 +153,8 @@ BookmarkBarGtk::~BookmarkBarGtk() { bookmark_toolbar_.Destroy(); event_box_.Destroy(); -#if defined(BROWSER_SYNC) if (sync_service_) sync_service_->RemoveObserver(this); -#endif } void BookmarkBarGtk::SetProfile(Profile* profile) { @@ -267,12 +261,10 @@ void BookmarkBarGtk::Init(Profile* profile) { g_signal_connect(vseparator, "expose-event", G_CALLBACK(OnSeparatorExpose), this); -#if defined(BROWSER_SYNC) sync_error_button_ = theme_provider_->BuildChromeButton(); ConnectFolderButtonEvents(sync_error_button_); gtk_box_pack_start(GTK_BOX(bookmark_hbox_), sync_error_button_, FALSE, FALSE, 0); -#endif // We pack the button manually (rather than using gtk_button_set_*) so that // we can have finer control over its label. @@ -337,11 +329,9 @@ void BookmarkBarGtk::Hide(bool animate) { } } -#if defined(BROWSER_SYNC) void BookmarkBarGtk::OnStateChanged() { // TODO(zork): TODO } -#endif void BookmarkBarGtk::EnterFullscreen() { if (ShouldBeFloating()) diff --git a/chrome/browser/gtk/bookmark_bar_gtk.h b/chrome/browser/gtk/bookmark_bar_gtk.h index 9745fd7..4f4b7b7 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.h +++ b/chrome/browser/gtk/bookmark_bar_gtk.h @@ -33,9 +33,7 @@ class TabstripOriginProvider; struct GtkThemeProvider; class BookmarkBarGtk : public AnimationDelegate, -#if defined(BROWSER_SYNC) public ProfileSyncServiceObserver, -#endif public BookmarkModelObserver, public MenuBarHelper::Delegate, public NotificationObserver { @@ -264,7 +262,6 @@ class BookmarkBarGtk : public AnimationDelegate, GtkAllocation* allocation, BookmarkBarGtk* bar); -#if defined(BROWSER_SYNC) // ProfileSyncServiceObserver method. virtual void OnStateChanged(); @@ -274,7 +271,6 @@ class BookmarkBarGtk : public AnimationDelegate, // Creates the sync error button and adds it as a child view. GtkWidget* CreateSyncErrorButton(); -#endif Profile* profile_; @@ -320,14 +316,12 @@ class BookmarkBarGtk : public AnimationDelegate, // The other bookmarks button. GtkWidget* other_bookmarks_button_; -#if defined(BROWSER_SYNC) // The sync re-login indicator which appears when the user needs to re-enter // credentials in order to continue syncing. GtkWidget* sync_error_button_; // A pointer to the ProfileSyncService instance if one exists. ProfileSyncService* sync_service_; -#endif // The BookmarkNode from the model being dragged. NULL when we aren't // dragging. diff --git a/chrome/browser/gtk/standard_menus.cc b/chrome/browser/gtk/standard_menus.cc index 8342408..7c8205f 100644 --- a/chrome/browser/gtk/standard_menus.cc +++ b/chrome/browser/gtk/standard_menus.cc @@ -94,10 +94,8 @@ struct MenuCreateMaterial standard_app_menu_materials[] = { GDK_j, GDK_CONTROL_MASK }, { MENU_NORMAL, IDC_MANAGE_EXTENSIONS, IDS_SHOW_EXTENSIONS }, { MENU_SEPARATOR }, -#if defined(BROWSER_SYNC) { MENU_NORMAL, IDC_SYNC_BOOKMARKS, IDS_SYNC_MY_BOOKMARKS_LABEL}, { MENU_SEPARATOR }, -#endif { MENU_NORMAL, IDC_OPTIONS, IDS_OPTIONS, IDS_PRODUCT_NAME }, { MENU_NORMAL, IDC_ABOUT, IDS_ABOUT, IDS_PRODUCT_NAME }, { MENU_NORMAL, IDC_HELP_PAGE, IDS_HELP_PAGE, 0, NULL, GDK_F1 }, diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index e44a61c..82c4d26 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -727,9 +727,7 @@ ProfileImpl::~ProfileImpl() { prefs->RemovePrefObserver(prefs::kEnableSpellCheck, this); prefs->RemovePrefObserver(prefs::kEnableAutoSpellCorrect, this); -#if defined(BROWSER_SYNC) sync_service_.reset(); -#endif // Both HistoryService and WebDataService maintain threads for background // processing. Its possible each thread still has tasks on it that have @@ -1355,7 +1353,7 @@ void ProfileImpl::StopCreateSessionServiceTimer() { } ProfileSyncService* ProfileImpl::GetProfileSyncService() { -#if defined(BROWSER_SYNC) && !defined(OS_POSIX) +#if !defined(OS_POSIX) if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync)) { if (!sync_service_.get()) InitSyncService(); @@ -1366,8 +1364,6 @@ ProfileSyncService* ProfileImpl::GetProfileSyncService() { } void ProfileImpl::InitSyncService() { -#if defined(BROWSER_SYNC) sync_service_.reset(new ProfileSyncService(this)); sync_service_->Initialize(); -#endif } diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h index 741b5cf..77abf02 100644 --- a/chrome/browser/profile.h +++ b/chrome/browser/profile.h @@ -500,9 +500,7 @@ class ProfileImpl : public Profile, scoped_ptr<BookmarkModel> bookmark_bar_model_; scoped_refptr<WebResourceService> web_resource_service_; -#if defined(BROWSER_SYNC) scoped_ptr<ProfileSyncService> sync_service_; -#endif ChromeURLRequestContextGetter* request_context_; diff --git a/chrome/browser/sync/glue/bookmark_model_worker.cc b/chrome/browser/sync/glue/bookmark_model_worker.cc index 2425269..d358bfd 100644 --- a/chrome/browser/sync/glue/bookmark_model_worker.cc +++ b/chrome/browser/sync/glue/bookmark_model_worker.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include "chrome/browser/sync/glue/bookmark_model_worker.h" #include "base/message_loop.h" @@ -110,5 +108,3 @@ void BookmarkModelWorker::CallDoWorkAndSignalTask::Run() { } } // namespace browser_sync - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/bookmark_model_worker.h b/chrome/browser/sync/glue/bookmark_model_worker.h index 8b47729..f2c80a1 100644 --- a/chrome/browser/sync/glue/bookmark_model_worker.h +++ b/chrome/browser/sync/glue/bookmark_model_worker.h @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #ifndef CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_WORKER_H_ #define CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_WORKER_H_ @@ -130,5 +128,3 @@ class BookmarkModelWorker } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_WORKER_H_ - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/bookmark_model_worker_unittest.cc b/chrome/browser/sync/glue/bookmark_model_worker_unittest.cc index 0576732..183e2f5 100644 --- a/chrome/browser/sync/glue/bookmark_model_worker_unittest.cc +++ b/chrome/browser/sync/glue/bookmark_model_worker_unittest.cc @@ -1,7 +1,6 @@ // Copyright (c) 2006-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. -#if defined(BROWSER_SYNC) #include "base/thread.h" #include "chrome/browser/sync/engine/syncapi.h" @@ -220,5 +219,3 @@ TEST_F(BookmarkModelWorkerTest, HypotheticalManualPumpFlooding) { EXPECT_FALSE(syncer_thread()->IsRunning()); core_thread()->Stop(); } - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/change_processor.cc b/chrome/browser/sync/glue/change_processor.cc index ccc65043..5bf0e1a 100644 --- a/chrome/browser/sync/glue/change_processor.cc +++ b/chrome/browser/sync/glue/change_processor.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include "chrome/browser/sync/glue/change_processor.h" #include "app/gfx/codec/png_codec.h" @@ -545,5 +543,3 @@ void ChangeProcessor::SetSyncNodeFavicon( } } // namespace browser_sync - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/change_processor.h b/chrome/browser/sync/glue/change_processor.h index 355c058..55c0c66 100644 --- a/chrome/browser/sync/glue/change_processor.h +++ b/chrome/browser/sync/glue/change_processor.h @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #ifndef CHROME_BROWSER_SYNC_GLUE_CHANGE_PROCESSOR_H_ #define CHROME_BROWSER_SYNC_GLUE_CHANGE_PROCESSOR_H_ @@ -184,5 +182,3 @@ class ChangeProcessor : public BookmarkModelObserver, } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_CHANGE_APPLICATOR_H_ - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/http_bridge.cc b/chrome/browser/sync/glue/http_bridge.cc index c019cba..56d3ebf9 100644 --- a/chrome/browser/sync/glue/http_bridge.cc +++ b/chrome/browser/sync/glue/http_bridge.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include "chrome/browser/sync/glue/http_bridge.h" #include "base/message_loop.h" @@ -238,5 +236,3 @@ void HttpBridge::OnURLFetchComplete(const URLFetcher *source, const GURL &url, } } // namespace browser_sync - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/http_bridge.h b/chrome/browser/sync/glue/http_bridge.h index 12500ec..7164bd5 100644 --- a/chrome/browser/sync/glue/http_bridge.h +++ b/chrome/browser/sync/glue/http_bridge.h @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #ifndef CHROME_BROWSER_SYNC_GLUE_HTTP_BRIDGE_H_ #define CHROME_BROWSER_SYNC_GLUE_HTTP_BRIDGE_H_ @@ -200,5 +198,3 @@ class HttpBridgeFactory } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_HTTP_BRIDGE_H_ - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc index c34ad25..b64f5e3 100644 --- a/chrome/browser/sync/glue/http_bridge_unittest.cc +++ b/chrome/browser/sync/glue/http_bridge_unittest.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include "base/thread.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/sync/glue/http_bridge.h" @@ -224,5 +222,3 @@ TEST_F(HttpBridgeTest, TestExtraRequestHeaders) { EXPECT_NE(std::string::npos, response.find("fnord")); EXPECT_NE(std::string::npos, response.find(test_payload.c_str())); } - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/model_associator.cc b/chrome/browser/sync/glue/model_associator.cc index 53cb5acc..c481da5 100644 --- a/chrome/browser/sync/glue/model_associator.cc +++ b/chrome/browser/sync/glue/model_associator.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include "chrome/browser/sync/glue/model_associator.h" #include <stack> @@ -509,5 +507,3 @@ bool ModelAssociator::LoadAssociations() { } } // namespace browser_sync - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/model_associator.h b/chrome/browser/sync/glue/model_associator.h index dc6aaba..0304bf5 100644 --- a/chrome/browser/sync/glue/model_associator.h +++ b/chrome/browser/sync/glue/model_associator.h @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #ifndef CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCIATOR_H_ #define CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCIATOR_H_ @@ -140,4 +138,3 @@ class ModelAssociator } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCIATOR_H_ -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc index 4c38711..b10659c 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include "build/build_config.h" #include "base/file_version_info.h" #include "base/file_util.h" @@ -313,5 +311,3 @@ void SyncBackendHost::Core::SaveChanges() { } } // namespace browser_sync - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h index f0a1cd4..8697e0d 100644 --- a/chrome/browser/sync/glue/sync_backend_host.h +++ b/chrome/browser/sync/glue/sync_backend_host.h @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ @@ -288,4 +286,3 @@ class SyncBackendHost { } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 08d486c..0a0e9f9 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) #include "chrome/browser/sync/profile_sync_service.h" #include <stack> @@ -212,7 +211,7 @@ void ProfileSyncService::UpdateLastSyncedTime() { void ProfileSyncService::OnUnrecoverableError() { unrecoverable_error_detected_ = true; change_processor_->Stop(); - + // Tell the wizard so it can inform the user only if it is already open. wizard_.Step(SyncSetupWizard::FATAL_ERROR); FOR_EACH_OBSERVER(Observer, observers_, OnStateChanged()); @@ -427,5 +426,3 @@ bool ProfileSyncService::ShouldPushChanges() { // consistent with one another, and no unrecoverable error has transpired. return change_processor_->IsRunning(); } - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index eca2480..8976703f 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ @@ -313,5 +311,3 @@ class ProfileSyncService : public NotificationObserver, }; #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc index 994bc83..760f51f 100644 --- a/chrome/browser/sync/profile_sync_service_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_unittest.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include <stack> #include <vector> @@ -1282,5 +1280,3 @@ TEST_F(ProfileSyncServiceTestWithData, RecoverAfterDeletingSyncDataDirectory) { ExpectBookmarkModelMatchesTestData(); ExpectModelMatch(); } - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc index 50ab515..4f60825 100644 --- a/chrome/browser/sync/sync_setup_flow.cc +++ b/chrome/browser/sync/sync_setup_flow.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include "chrome/browser/sync/sync_setup_flow.h" #include "app/gfx/font.h" @@ -300,5 +298,3 @@ SyncSetupFlow* SyncSetupFlow::Run(ProfileSyncService* service, b->BrowserShowHtmlDialog(flow, NULL); return flow; } - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_setup_flow.h b/chrome/browser/sync/sync_setup_flow.h index 20668ee..98345fc 100644 --- a/chrome/browser/sync/sync_setup_flow.h +++ b/chrome/browser/sync/sync_setup_flow.h @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #ifndef CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ #define CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ @@ -186,4 +184,3 @@ class FlowHandler : public DOMMessageHandler { }; #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_setup_wizard.cc b/chrome/browser/sync/sync_setup_wizard.cc index 5c55730..e738b14 100644 --- a/chrome/browser/sync/sync_setup_wizard.cc +++ b/chrome/browser/sync/sync_setup_wizard.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include "chrome/browser/sync/sync_setup_wizard.h" #include "app/resource_bundle.h" @@ -196,5 +194,3 @@ SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( "Invalid start state for discrete run: " << start_state; return result; } - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_setup_wizard_unittest.cc b/chrome/browser/sync/sync_setup_wizard_unittest.cc index 847750f..10f5a7a 100644 --- a/chrome/browser/sync/sync_setup_wizard_unittest.cc +++ b/chrome/browser/sync/sync_setup_wizard_unittest.cc @@ -1,8 +1,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include "testing/gtest/include/gtest/gtest.h" #include "base/json/json_writer.h" @@ -372,5 +370,3 @@ TEST_F(SyncSetupWizardTest, DiscreteRun) { wizard_->Step(SyncSetupWizard::GAIA_SUCCESS); EXPECT_TRUE(test_window_->TestAndResetWasShowHTMLDialogCalled()); } - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_status_ui_helper.cc b/chrome/browser/sync/sync_status_ui_helper.cc index 8ec8a17..37b790a 100644 --- a/chrome/browser/sync/sync_status_ui_helper.cc +++ b/chrome/browser/sync/sync_status_ui_helper.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #include "chrome/browser/sync/sync_status_ui_helper.h" #include "app/l10n_util.h" @@ -116,5 +114,3 @@ SyncStatusUIHelper::MessageType SyncStatusUIHelper::GetLabels( } return result_type; } - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_status_ui_helper.h b/chrome/browser/sync/sync_status_ui_helper.h index e5da495..e54db5d 100644 --- a/chrome/browser/sync/sync_status_ui_helper.h +++ b/chrome/browser/sync/sync_status_ui_helper.h @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(BROWSER_SYNC) - #ifndef CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ #define CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ @@ -31,4 +29,3 @@ class SyncStatusUIHelper { }; #endif // CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index 2bb0fc8..2e9b167 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -114,10 +114,8 @@ static const SkColor kInstructionsColor = SkColorSetRGB(128, 128, 142); // Tag for the 'Other bookmarks' button. static const int kOtherFolderButtonTag = 1; -#if defined(BROWSER_SYNC) // Tag for the sync error button. static const int kSyncErrorButtonTag = 2; -#endif namespace { @@ -370,23 +368,19 @@ BookmarkBarView::BookmarkBarView(Profile* profile, Browser* browser) other_bookmarked_button_(NULL), model_changed_listener_(NULL), show_folder_drop_menu_task_(NULL), -#if defined(BROWSER_SYNC) sync_error_button_(NULL), sync_service_(NULL), -#endif overflow_button_(NULL), instructions_(NULL), bookmarks_separator_view_(NULL), browser_(browser), throbbing_view_(NULL) { -#if defined(BROWSER_SYNC) if (profile->GetProfileSyncService()) { // Obtain a pointer to the profile sync service and add our instance as an // observer. sync_service_ = profile->GetProfileSyncService(); sync_service_->AddObserver(this); } -#endif SetID(VIEW_ID_BOOKMARK_BAR); Init(); @@ -404,10 +398,8 @@ BookmarkBarView::~BookmarkBarView() { model_->RemoveObserver(this); StopShowFolderDropMenuTimer(); -#if defined(BROWSER_SYNC) if (sync_service_) sync_service_->RemoveObserver(this); -#endif } void BookmarkBarView::SetProfile(Profile* profile) { @@ -466,11 +458,9 @@ gfx::Size BookmarkBarView::GetMinimumSize() { } int sync_error_total_width = 0; -#if defined(BROWSER_SYNC) gfx::Size sync_error_button_pref = sync_error_button_->GetPreferredSize(); if (ShouldShowSyncErrorButton()) sync_error_total_width += kButtonPadding + sync_error_button_pref.width(); -#endif gfx::Size other_bookmarked_pref = other_bookmarked_button_->GetPreferredSize(); @@ -718,7 +708,6 @@ void BookmarkBarView::SetAccessibleName(const std::wstring& name) { accessible_name_.assign(name); } -#if defined(BROWSER_SYNC) void BookmarkBarView::OnStateChanged() { // When the sync state changes, it is sufficient to invoke View::Layout since // during layout we query the profile sync service and determine whether the @@ -732,7 +721,6 @@ void BookmarkBarView::OnStateChanged() { Layout(); SchedulePaint(); } -#endif // defined(BROWSER_SYNC) void BookmarkBarView::OnFullscreenToggled(bool fullscreen) { if (!fullscreen) @@ -878,10 +866,8 @@ void BookmarkBarView::Init() { other_bookmarked_button_ = CreateOtherBookmarkedButton(); AddChildView(other_bookmarked_button_); -#if defined(BROWSER_SYNC) sync_error_button_ = CreateSyncErrorButton(); AddChildView(sync_error_button_); -#endif overflow_button_ = CreateOverflowButton(); AddChildView(overflow_button_); @@ -937,16 +923,10 @@ MenuButton* BookmarkBarView::CreateOverflowButton() { } int BookmarkBarView::GetBookmarkButtonCount() { -#if defined(BROWSER_SYNC) // We contain at least four non-bookmark button views: other bookmarks, // bookmarks separator, chevrons (for overflow), the instruction label and // the sync error button. return GetChildViewCount() - 5; -#else - // We contain at least four non-bookmark button views: other bookmarks, - // bookmarks separator, chevrons (for overflow) and the instruction label. - return GetChildViewCount() - 4; -#endif } void BookmarkBarView::Loaded(BookmarkModel* model) { @@ -1161,7 +1141,6 @@ void BookmarkBarView::RunMenu(views::View* view, const gfx::Point& pt) { void BookmarkBarView::ButtonPressed(views::Button* sender, const views::Event& event) { -#if defined(BROWSER_SYNC) // Show the login wizard if the user clicked the re-login button. if (sender->tag() == kSyncErrorButtonTag) { DCHECK(sender == sync_error_button_); @@ -1169,7 +1148,6 @@ void BookmarkBarView::ButtonPressed(views::Button* sender, sync_service_->ShowLoginDialog(); return; } -#endif const BookmarkNode* node; if (sender->tag() == kOtherFolderButtonTag) { @@ -1592,13 +1570,11 @@ gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) { bookmarks_separator_view_->GetPreferredSize(); int sync_error_total_width = 0; -#if defined(BROWSER_SYNC) gfx::Size sync_error_button_pref = sync_error_button_->GetPreferredSize(); const bool should_show_sync_error_button = ShouldShowSyncErrorButton(); if (should_show_sync_error_button) { sync_error_total_width += kButtonPadding + sync_error_button_pref.width(); } -#endif const int max_x = width - other_bookmarked_pref.width() - kButtonPadding - overflow_pref.width() - kButtonPadding - bookmarks_separator_pref.width() - sync_error_total_width; @@ -1667,7 +1643,6 @@ gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) { } x += other_bookmarked_pref.width() + kButtonPadding; -#if defined(BROWSER_SYNC) // Set the real bounds of the sync error button only if it needs to appear on // the bookmarks bar. if (should_show_sync_error_button) { @@ -1682,7 +1657,6 @@ gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) { sync_error_button_->SetBounds(x, y, 0, height); sync_error_button_->SetVisible(false); } -#endif // defined(BROWSER_SYNC) // Set the preferred size computed so far. if (compute_bounds_only) { @@ -1702,7 +1676,6 @@ gfx::Size BookmarkBarView::LayoutItems(bool compute_bounds_only) { return prefsize; } -#if defined(BROWSER_SYNC) // The sync state reported by the profile sync service determines whether or // not the re-login indicator button should be visible. bool BookmarkBarView::ShouldShowSyncErrorButton() { @@ -1736,4 +1709,3 @@ views::TextButton* BookmarkBarView::CreateSyncErrorButton() { *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); return sync_error_button; } -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/views/bookmark_bar_view.h b/chrome/browser/views/bookmark_bar_view.h index 0d79cc6..49ac37f 100644 --- a/chrome/browser/views/bookmark_bar_view.h +++ b/chrome/browser/views/bookmark_bar_view.h @@ -36,9 +36,7 @@ class TextButton; // waits until the HistoryService for the profile has been loaded before // creating the BookmarkModel. class BookmarkBarView : public DetachableToolbarView, -#if defined(BROWSER_SYNC) public ProfileSyncServiceObserver, -#endif public BookmarkModelObserver, public views::ViewMenuDelegate, public views::ButtonListener, @@ -118,10 +116,8 @@ class BookmarkBarView : public DetachableToolbarView, virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); virtual void SetAccessibleName(const std::wstring& name); -#if defined(BROWSER_SYNC) // ProfileSyncServiceObserver method. virtual void OnStateChanged(); -#endif // Called when fullscreen mode toggles on or off; this affects our layout. void OnFullscreenToggled(bool fullscreen); @@ -418,14 +414,13 @@ class BookmarkBarView : public DetachableToolbarView, // desired bounds. If |compute_bounds_only| = FALSE, the bounds are set. gfx::Size LayoutItems(bool compute_bounds_only); -#if defined(BROWSER_SYNC) // Determines whether the sync error button should appear on the bookmarks // bar. bool ShouldShowSyncErrorButton(); // Creates the sync error button and adds it as a child view. views::TextButton* CreateSyncErrorButton(); -#endif + NotificationRegistrar registrar_; Profile* profile_; @@ -458,14 +453,12 @@ class BookmarkBarView : public DetachableToolbarView, // Used to track drops on the bookmark bar view. scoped_ptr<DropInfo> drop_info_; -#if defined(BROWSER_SYNC) // The sync re-login indicator which appears when the user needs to re-enter // credentials in order to continue syncing. views::TextButton* sync_error_button_; // A pointer to the ProfileSyncService instance if one exists. ProfileSyncService* sync_service_; -#endif // Visible if not all the bookmark buttons fit. views::MenuButton* overflow_button_; diff --git a/chrome/browser/views/bookmark_manager_view.cc b/chrome/browser/views/bookmark_manager_view.cc index ce40b28..5cb0375 100644 --- a/chrome/browser/views/bookmark_manager_view.cc +++ b/chrome/browser/views/bookmark_manager_view.cc @@ -165,10 +165,8 @@ BookmarkManagerView::BookmarkManagerView(Profile* profile) : profile_(profile->GetOriginalProfile()), table_view_(NULL), tree_view_(NULL), -#if defined(BROWSER_SYNC) sync_status_button_(NULL), sync_service_(NULL), -#endif ALLOW_THIS_IN_INITIALIZER_LIST(search_factory_(this)) { search_tf_ = new views::Textfield(); search_tf_->set_default_width_in_chars(30); @@ -207,10 +205,8 @@ BookmarkManagerView::BookmarkManagerView(Profile* profile) 0, views::GridLayout::USE_PREF, 0, 0); column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0); -#if defined(BROWSER_SYNC) column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0); -#endif column_set->AddPaddingColumn(1, kUnrelatedControlHorizontalSpacing); column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0); @@ -226,10 +222,8 @@ BookmarkManagerView::BookmarkManagerView(Profile* profile) layout->StartRow(0, top_id); layout->AddView(organize_menu_button); layout->AddView(tools_menu_button); -#if defined(BROWSER_SYNC) sync_status_button_ = new views::TextButton(this, std::wstring()); layout->AddView(sync_status_button_); -#endif layout->AddView(new views::Label( l10n_util::GetString(IDS_BOOKMARK_MANAGER_SEARCH_TITLE))); layout->AddView(search_tf_); @@ -246,13 +240,11 @@ BookmarkManagerView::BookmarkManagerView(Profile* profile) if (!bookmark_model->IsLoaded()) bookmark_model->AddObserver(this); -#if defined(BROWSER_SYNC) if (profile->GetProfileSyncService()) { sync_service_ = profile_->GetProfileSyncService(); sync_service_->AddObserver(this); UpdateSyncStatus(); } -#endif } BookmarkManagerView::~BookmarkManagerView() { @@ -271,10 +263,8 @@ BookmarkManagerView::~BookmarkManagerView() { manager = NULL; open_window = NULL; -#if defined(BROWSER_SYNC) if (sync_service_) sync_service_->RemoveObserver(this); -#endif } // static @@ -383,11 +373,9 @@ void BookmarkManagerView::WindowClosing() { prefs::kBookmarkManagerSplitLocation, split_view_->divider_offset()); } -#if defined(BROWSER_SYNC) void BookmarkManagerView::OnStateChanged() { UpdateSyncStatus(); } -#endif bool BookmarkManagerView::AcceleratorPressed( const views::Accelerator& accelerator) { @@ -521,7 +509,6 @@ void BookmarkManagerView::OnTreeViewKeyDown(base::KeyboardCode keycode) { } } -#if defined(BROWSER_SYNC) void BookmarkManagerView::ButtonPressed(views::Button* sender, const views::Event& event) { if (sender == sync_status_button_) { @@ -529,7 +516,6 @@ void BookmarkManagerView::ButtonPressed(views::Button* sender, OpenSyncMyBookmarksDialog(); } } -#endif void BookmarkManagerView::Loaded(BookmarkModel* model) { model->RemoveObserver(this); @@ -832,7 +818,6 @@ void BookmarkManagerView::ShowExportBookmarksFileChooser() { reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU)); } -#if defined(BROWSER_SYNC) void BookmarkManagerView::UpdateSyncStatus() { DCHECK(sync_service_); std::wstring status_label; @@ -862,4 +847,3 @@ void BookmarkManagerView::OpenSyncMyBookmarksDialog() { ProfileSyncService::START_FROM_BOOKMARK_MANAGER); } } -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/views/bookmark_manager_view.h b/chrome/browser/views/bookmark_manager_view.h index 37bc746..c8de962 100644 --- a/chrome/browser/views/bookmark_manager_view.h +++ b/chrome/browser/views/bookmark_manager_view.h @@ -44,10 +44,8 @@ class BookmarkManagerView : public views::View, public views::TreeViewController, public views::ViewMenuDelegate, public views::WindowDelegate, -#if defined(BROWSER_SYNC) public views::ButtonListener, public ProfileSyncServiceObserver, -#endif public BookmarkModelObserver, public SelectFileDialog::Listener { public: @@ -95,10 +93,8 @@ class BookmarkManagerView : public views::View, //virtual bool ShouldShowWindowIcon() const { return true; } virtual void WindowClosing(); -#if defined(BROWSER_SYNC) // ProfileSyncServiceObserver method. virtual void OnStateChanged(); -#endif Profile* profile() const { return profile_; } @@ -119,10 +115,8 @@ class BookmarkManagerView : public views::View, virtual void OnTreeViewSelectionChanged(views::TreeView* tree_view); virtual void OnTreeViewKeyDown(base::KeyboardCode keycode); -#if defined(BROWSER_SYNC) // views::ButtonListener method. virtual void ButtonPressed(views::Button* sender, const views::Event& event); -#endif // BookmarkModelObserver. We're only installed as an observer until the // bookmarks are loaded. @@ -214,10 +208,8 @@ class BookmarkManagerView : public views::View, void ShowImportBookmarksFileChooser(); void ShowExportBookmarksFileChooser(); -#if defined(BROWSER_SYNC) void UpdateSyncStatus(); void OpenSyncMyBookmarksDialog(); -#endif Profile* profile_; BookmarkTableView* table_view_; @@ -230,14 +222,12 @@ class BookmarkManagerView : public views::View, // Import/export file dialog. scoped_refptr<SelectFileDialog> select_file_dialog_; -#if defined(BROWSER_SYNC) // The sync status button that notifies the user about the current status of // bookmarks synchronization. views::TextButton* sync_status_button_; // A pointer to the ProfileSyncService instance if one exists. ProfileSyncService* sync_service_; -#endif // Factory used for delaying search. ScopedRunnableMethodFactory<BookmarkManagerView> search_factory_; diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc index d378565..f5e99ff 100644 --- a/chrome/browser/views/options/content_page_view.cc +++ b/chrome/browser/views/options/content_page_view.cc @@ -36,14 +36,13 @@ namespace { const int kPasswordSavingRadioGroup = 1; const int kFormAutofillRadioGroup = 2; -#if defined(BROWSER_SYNC) // Background color for the status label when it's showing an error. static const SkColor kSyncLabelErrorBgColor = SkColorSetRGB(0xff, 0x9a, 0x9a); static views::Background* CreateErrorBackground() { return views::Background::CreateSolidBackground(kSyncLabelErrorBgColor); } -#endif + } // namespace ContentPageView::ContentPageView(Profile* profile) @@ -60,27 +59,21 @@ ContentPageView::ContentPageView(Profile* profile) browsing_data_group_(NULL), import_button_(NULL), clear_data_button_(NULL), -#if defined(BROWSER_SYNC) sync_group_(NULL), sync_status_label_(NULL), sync_action_link_(NULL), sync_start_stop_button_(NULL), sync_service_(NULL), -#endif OptionsPageView(profile) { -#if defined(BROWSER_SYNC) if (profile->GetProfileSyncService()) { sync_service_ = profile->GetProfileSyncService(); sync_service_->AddObserver(this); -#endif } } ContentPageView::~ContentPageView() { -#if defined(BROWSER_SYNC) if (sync_service_) sync_service_->RemoveObserver(this); -#endif } /////////////////////////////////////////////////////////////////////////////// @@ -126,7 +119,6 @@ void ContentPageView::ButtonPressed( GetWindow()->GetNativeWindow(), gfx::Rect(), new ClearBrowsingDataView(profile()))->Show(); -#if defined(BROWSER_SYNC) } else if (sender == sync_start_stop_button_) { DCHECK(sync_service_); @@ -146,7 +138,6 @@ void ContentPageView::ButtonPressed( sync_service_->EnableForUser(); ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); } -#endif } } @@ -159,11 +150,9 @@ void ContentPageView::LinkActivated(views::Link* source, int event_flags) { browser->window()->Activate(); return; } -#if defined(BROWSER_SYNC) DCHECK_EQ(source, sync_action_link_); DCHECK(sync_service_); sync_service_->ShowLoginDialog(); -#endif } //////////////////////////////////////////////////////////////////////////////// @@ -182,14 +171,12 @@ void ContentPageView::InitControlLayout() { column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, GridLayout::USE_PREF, 0, 0); -#if defined(BROWSER_SYNC) if (sync_service_) { layout->StartRow(0, single_column_view_set_id); InitSyncGroup(); layout->AddView(sync_group_); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); } -#endif layout->StartRow(0, single_column_view_set_id); InitPasswordSavingGroup(); @@ -245,10 +232,8 @@ void ContentPageView::NotifyPrefChanged(const std::wstring* pref_name) { // ContentsPageView, views::View overrides: void ContentPageView::Layout() { -#if defined(BROWSER_SYNC) if (is_initialized()) UpdateSyncControls(); -#endif // We need to Layout twice - once to get the width of the contents box... View::Layout(); passwords_asktosave_radio_->SetBounds( @@ -257,12 +242,10 @@ void ContentPageView::Layout() { 0, 0, passwords_group_->GetContentsWidth(), 0); browsing_data_label_->SetBounds( 0, 0, browsing_data_group_->GetContentsWidth(), 0); -#if defined(BROWSER_SYNC) if (is_initialized()) { sync_status_label_->SetBounds( 0, 0, sync_group_->GetContentsWidth(), 0); } -#endif // ... and twice to get the height of multi-line items correct. View::Layout(); } @@ -270,7 +253,7 @@ void ContentPageView::Layout() { /////////////////////////////////////////////////////////////////////////////// // ContentsPageView, ProfileSyncServiceObserver implementation: -#if defined(BROWSER_SYNC) + void ContentPageView::OnStateChanged() { // If the UI controls are not yet initialized, then don't do anything. This // can happen if the Options dialog is up, but the Content tab is not yet @@ -278,7 +261,6 @@ void ContentPageView::OnStateChanged() { if (is_initialized()) Layout(); } -#endif /////////////////////////////////////////////////////////////////////////////// // ContentPageView, private: @@ -439,7 +421,6 @@ void ContentPageView::OnConfirmMessageAccept() { ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); } -#if defined(BROWSER_SYNC) void ContentPageView::InitSyncGroup() { sync_status_label_ = new views::Label; sync_status_label_->SetMultiLine(true); @@ -503,5 +484,3 @@ void ContentPageView::UpdateSyncControls() { sync_action_link_->set_background(NULL); } } - -#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/views/options/content_page_view.h b/chrome/browser/views/options/content_page_view.h index 91febde..d79ede6 100644 --- a/chrome/browser/views/options/content_page_view.h +++ b/chrome/browser/views/options/content_page_view.h @@ -27,10 +27,8 @@ class PrefService; // ContentPageView class ContentPageView : public OptionsPageView, -#if defined(BROWSER_SYNC) public views::LinkController, public ProfileSyncServiceObserver, -#endif public views::ButtonListener, public ConfirmMessageBoxObserver { public: @@ -46,10 +44,8 @@ class ContentPageView : public OptionsPageView, // ConfirmMessageBoxObserver implementation. virtual void OnConfirmMessageAccept(); -#if defined(BROWSER_SYNC) // ProfileSyncServiceObserver method. virtual void OnStateChanged(); -#endif protected: // OptionsPageView implementation: @@ -60,7 +56,6 @@ class ContentPageView : public OptionsPageView, virtual void Layout(); private: -#if defined(BROWSER_SYNC) // Updates various sync controls based on the current sync state. void UpdateSyncControls(); @@ -71,16 +66,13 @@ class ContentPageView : public OptionsPageView, // are already initialized or not. return sync_group_ != NULL; } -#endif // Init all the dialog controls. void InitPasswordSavingGroup(); void InitFormAutofillGroup(); void InitBrowsingDataGroup(); void InitThemesGroup(); -#if defined(BROWSER_SYNC) void InitSyncGroup(); -#endif // Controls for the Password Saving group views::NativeButton* passwords_exceptions_button_; @@ -104,23 +96,19 @@ class ContentPageView : public OptionsPageView, views::NativeButton* import_button_; views::NativeButton* clear_data_button_; -#if defined(BROWSER_SYNC) // Controls for the Sync group. OptionsGroupView* sync_group_; views::Label* sync_status_label_; views::Link* sync_action_link_; views::NativeButton* sync_start_stop_button_; -#endif BooleanPrefMember ask_to_save_passwords_; BooleanPrefMember ask_to_save_form_autofill_; StringPrefMember is_using_default_theme_; -#if defined(BROWSER_SYNC) // Cached pointer to ProfileSyncService, if it exists. Kept up to date // and NULL-ed out on destruction. ProfileSyncService* sync_service_; -#endif DISALLOW_COPY_AND_ASSIGN(ContentPageView); }; diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index 68159f8..8194729 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -1173,7 +1173,6 @@ void ToolbarView::CreateAppMenu() { IDS_SHOW_EXTENSIONS); app_menu_contents_->AddSeparator(); -#if defined(BROWSER_SYNC) if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync)) { string16 label; string16 link; @@ -1189,7 +1188,6 @@ void ToolbarView::CreateAppMenu() { app_menu_contents_->AddItem(IDC_SYNC_BOOKMARKS, label); app_menu_contents_->AddSeparator(); } -#endif app_menu_contents_->AddItem(IDC_OPTIONS, l10n_util::GetStringFUTF16( IDS_OPTIONS, |