diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 21:41:40 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 21:41:40 +0000 |
commit | 1e6054763faf7283d3e2e53f26389ff5d83e7d90 (patch) | |
tree | 4132c689a3196890267eae8a57989cbfab36e438 /chrome/browser | |
parent | 0c5f45a87e93ac32d037ea015f67bceafbd2e340 (diff) | |
download | chromium_src-1e6054763faf7283d3e2e53f26389ff5d83e7d90.zip chromium_src-1e6054763faf7283d3e2e53f26389ff5d83e7d90.tar.gz chromium_src-1e6054763faf7283d3e2e53f26389ff5d83e7d90.tar.bz2 |
Almost done deinlining virtual methods.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/5841002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69470 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
48 files changed, 369 insertions, 166 deletions
diff --git a/chrome/browser/automation/ui_controls_internal.cc b/chrome/browser/automation/ui_controls_internal.cc new file mode 100644 index 0000000..25598e8 --- /dev/null +++ b/chrome/browser/automation/ui_controls_internal.cc @@ -0,0 +1,22 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/automation/ui_controls_internal.h" + +namespace ui_controls { + +ClickTask::ClickTask(MouseButton button, int state, Task* followup) + : button_(button), state_(state), followup_(followup) { +} + +ClickTask::~ClickTask() {} + +void ClickTask::Run() { + if (followup_) + SendMouseEventsNotifyWhenDone(button_, state_, followup_); + else + SendMouseEvents(button_, state_); +} + +} // ui_controls diff --git a/chrome/browser/automation/ui_controls_internal.h b/chrome/browser/automation/ui_controls_internal.h index 88631c9..7299b9b 100644 --- a/chrome/browser/automation/ui_controls_internal.h +++ b/chrome/browser/automation/ui_controls_internal.h @@ -16,18 +16,9 @@ class ClickTask : public Task { public: // A |followup| Task can be specified to notify the caller when the mouse // click event is sent. If can be NULL if the caller does not care about it. - ClickTask(MouseButton button, int state, Task* followup) - : button_(button), state_(state), followup_(followup) { - } - - virtual ~ClickTask() {} - - virtual void Run() { - if (followup_) - SendMouseEventsNotifyWhenDone(button_, state_, followup_); - else - SendMouseEvents(button_, state_); - } + ClickTask(MouseButton button, int state, Task* followup); + virtual ~ClickTask(); + virtual void Run(); private: MouseButton button_; diff --git a/chrome/browser/device_orientation/data_fetcher.h b/chrome/browser/device_orientation/data_fetcher.h index 1a599b7..2b57fa9 100644 --- a/chrome/browser/device_orientation/data_fetcher.h +++ b/chrome/browser/device_orientation/data_fetcher.h @@ -13,7 +13,6 @@ class DataFetcher { public: virtual ~DataFetcher() {} virtual bool GetOrientation(Orientation*) = 0; - virtual int MinSamplingIntervalMs() const { return 0; } }; } // namespace device_orientation diff --git a/chrome/browser/device_orientation/provider_impl.cc b/chrome/browser/device_orientation/provider_impl.cc index 5ebfdb6..dfe994a 100644 --- a/chrome/browser/device_orientation/provider_impl.cc +++ b/chrome/browser/device_orientation/provider_impl.cc @@ -189,12 +189,10 @@ int ProviderImpl::SamplingIntervalMs() const { DCHECK(MessageLoop::current() == polling_thread_->message_loop()); DCHECK(data_fetcher_.get()); - int fetcher_interval = data_fetcher_->MinSamplingIntervalMs(); - - if (fetcher_interval > kDesiredSamplingIntervalMs) - return fetcher_interval; - else - return kDesiredSamplingIntervalMs; + // TODO(erg): There used to be unused code here, that called a default + // implementation on the DataFetcherInterface that was never defined. I'm + // removing unused methods from headers. + return kDesiredSamplingIntervalMs; } } // namespace device_orientation diff --git a/chrome/browser/dom_ui/bug_report_ui.cc b/chrome/browser/dom_ui/bug_report_ui.cc index dd25636..545df18 100644 --- a/chrome/browser/dom_ui/bug_report_ui.cc +++ b/chrome/browser/dom_ui/bug_report_ui.cc @@ -30,7 +30,6 @@ #include "chrome/common/jstemplate_builder.h" #include "chrome/common/url_constants.h" #include "gfx/rect.h" -#include "views/window/window.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" @@ -45,6 +44,10 @@ #include "app/win_util.h" #endif +#if defined(TOOLKIT_VIEWS) +#include "views/window/window.h" +#endif + #if defined(OS_CHROMEOS) #include "base/file_util.h" #include "base/path_service.h" diff --git a/chrome/browser/extensions/extension_tts_api.cc b/chrome/browser/extensions/extension_tts_api.cc index 0d18faa..322085f 100644 --- a/chrome/browser/extensions/extension_tts_api.cc +++ b/chrome/browser/extensions/extension_tts_api.cc @@ -18,11 +18,33 @@ const char kCrosLibraryNotLoadedError[] = const int kSpeechCheckDelayIntervalMs = 100; }; +std::string ExtensionTtsPlatformImpl::error() { + return error_; +} + +void ExtensionTtsPlatformImpl::clear_error() { + error_ = std::string(); +} + +void ExtensionTtsPlatformImpl::set_error(const std::string& error) { + error_ = error; +} + // static ExtensionTtsController* ExtensionTtsController::GetInstance() { return Singleton<ExtensionTtsController>::get(); } +ExtensionTtsController::Utterance::Utterance() + : rate(-1.0), + pitch(-1.0), + volume(-1.0), + success_task(NULL), + failure_task(NULL) { +} + +ExtensionTtsController::Utterance::~Utterance() {} + ExtensionTtsController::ExtensionTtsController() : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), current_utterance_(NULL), diff --git a/chrome/browser/extensions/extension_tts_api.h b/chrome/browser/extensions/extension_tts_api.h index 2f99f20..2e4e9bb 100644 --- a/chrome/browser/extensions/extension_tts_api.h +++ b/chrome/browser/extensions/extension_tts_api.h @@ -40,9 +40,9 @@ class ExtensionTtsPlatformImpl { // Return true if the synthesis engine is currently speaking. virtual bool IsSpeaking() = 0; - virtual std::string error() { return error_; } - virtual void clear_error() { error_ = std::string(); } - virtual void set_error(const std::string& error) { error_ = error; } + virtual std::string error(); + virtual void clear_error(); + virtual void set_error(const std::string& error); protected: ExtensionTtsPlatformImpl() {} @@ -60,13 +60,8 @@ class ExtensionTtsController { static ExtensionTtsController* GetInstance(); struct Utterance { - Utterance() - : rate(-1.0), - pitch(-1.0), - volume(-1.0), - success_task(NULL), - failure_task(NULL) { - } + Utterance(); + ~Utterance(); std::string text; std::string language; diff --git a/chrome/browser/gpu_blacklist.cc b/chrome/browser/gpu_blacklist.cc index 6bb33c6..fe246d6 100644 --- a/chrome/browser/gpu_blacklist.cc +++ b/chrome/browser/gpu_blacklist.cc @@ -102,6 +102,8 @@ GpuBlacklist::OsInfo::OsInfo(const std::string& os, } } +GpuBlacklist::OsInfo::~OsInfo() {} + bool GpuBlacklist::OsInfo::Contains(OsType type, const Version& version) const { if (!IsValid()) @@ -214,6 +216,8 @@ GpuBlacklist::GpuBlacklistEntry::GetGpuBlacklistEntryFromValue( return entry; } +GpuBlacklist::GpuBlacklistEntry::~GpuBlacklistEntry() {} + GpuBlacklist::GpuBlacklistEntry::GpuBlacklistEntry() : vendor_id_(0), device_id_(0) { diff --git a/chrome/browser/gpu_blacklist.h b/chrome/browser/gpu_blacklist.h index ee556b3..85c4145 100644 --- a/chrome/browser/gpu_blacklist.h +++ b/chrome/browser/gpu_blacklist.h @@ -116,6 +116,7 @@ class GpuBlacklist { const std::string& version_op, const std::string& version_string, const std::string& version_string2); + ~OsInfo(); // Determines if a given os/version is included in the OsInfo set. bool Contains(OsType type, const Version& version) const; @@ -150,6 +151,8 @@ class GpuBlacklist { // Returns the GpuFeatureFlags. GpuFeatureFlags GetGpuFeatureFlags() const; + ~GpuBlacklistEntry(); + private: GpuBlacklistEntry(); diff --git a/chrome/browser/gtk/first_run_bubble.cc b/chrome/browser/gtk/first_run_bubble.cc index 343f57b..119166b 100644 --- a/chrome/browser/gtk/first_run_bubble.cc +++ b/chrome/browser/gtk/first_run_bubble.cc @@ -48,6 +48,10 @@ void FirstRunBubble::InfoBubbleClosing(InfoBubbleGtk* info_bubble, // TODO(port): Enable parent window } +bool FirstRunBubble::CloseOnEscape() { + return true; +} + void FirstRunBubble::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { diff --git a/chrome/browser/gtk/first_run_bubble.h b/chrome/browser/gtk/first_run_bubble.h index f6f7e8c..220c4f6 100644 --- a/chrome/browser/gtk/first_run_bubble.h +++ b/chrome/browser/gtk/first_run_bubble.h @@ -35,7 +35,7 @@ class FirstRunBubble : public InfoBubbleGtkDelegate, // is about to be closed. virtual void InfoBubbleClosing(InfoBubbleGtk* info_bubble, bool closed_by_escape); - virtual bool CloseOnEscape() { return true; } + virtual bool CloseOnEscape(); // Overridden from NotificationObserver: virtual void Observe(NotificationType type, diff --git a/chrome/browser/gtk/notifications/balloon_view_gtk.cc b/chrome/browser/gtk/notifications/balloon_view_gtk.cc index 6c2cc7e..bbca070 100644 --- a/chrome/browser/gtk/notifications/balloon_view_gtk.cc +++ b/chrome/browser/gtk/notifications/balloon_view_gtk.cc @@ -126,6 +126,10 @@ gfx::Size BalloonViewImpl::GetSize() const { return gfx::Size(GetDesiredTotalWidth(), GetDesiredTotalHeight()); } +BalloonHost* BalloonViewImpl::GetHost() const { + return html_contents_.get(); +} + void BalloonViewImpl::DelayedClose(bool by_user) { html_contents_->Shutdown(); if (frame_container_) { diff --git a/chrome/browser/gtk/notifications/balloon_view_gtk.h b/chrome/browser/gtk/notifications/balloon_view_gtk.h index dce5869..de95e71 100644 --- a/chrome/browser/gtk/notifications/balloon_view_gtk.h +++ b/chrome/browser/gtk/notifications/balloon_view_gtk.h @@ -46,7 +46,7 @@ class BalloonViewImpl : public BalloonView, virtual void RepositionToBalloon(); virtual void Close(bool by_user); virtual gfx::Size GetSize() const; - virtual BalloonHost* GetHost() const { return html_contents_.get(); } + virtual BalloonHost* GetHost() const; private: // NotificationObserver interface. diff --git a/chrome/browser/modal_html_dialog_delegate.cc b/chrome/browser/modal_html_dialog_delegate.cc index 09b4c4a1..b9438cf 100644 --- a/chrome/browser/modal_html_dialog_delegate.cc +++ b/chrome/browser/modal_html_dialog_delegate.cc @@ -69,3 +69,7 @@ void ModalHtmlDialogDelegate::OnDialogClosed(const std::string& json_retval) { // We are done with this request, so delete us. delete this; } + +bool ModalHtmlDialogDelegate::ShouldShowDialogTitle() const { + return true; +} diff --git a/chrome/browser/modal_html_dialog_delegate.h b/chrome/browser/modal_html_dialog_delegate.h index 9336b3b..dbdd812 100644 --- a/chrome/browser/modal_html_dialog_delegate.h +++ b/chrome/browser/modal_html_dialog_delegate.h @@ -47,7 +47,7 @@ class ModalHtmlDialogDelegate virtual std::string GetDialogArgs() const; virtual void OnDialogClosed(const std::string& json_retval); virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) { } - virtual bool ShouldShowDialogTitle() const { return true; } + virtual bool ShouldShowDialogTitle() const; private: NotificationRegistrar registrar_; diff --git a/chrome/browser/policy/dummy_configuration_policy_provider.cc b/chrome/browser/policy/dummy_configuration_policy_provider.cc new file mode 100644 index 0000000..9a8f491 --- /dev/null +++ b/chrome/browser/policy/dummy_configuration_policy_provider.cc @@ -0,0 +1,22 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/policy/dummy_configuration_policy_provider.h" + +namespace policy { + +DummyConfigurationPolicyProvider::DummyConfigurationPolicyProvider( + const PolicyDefinitionList* policy_list) + : ConfigurationPolicyProvider(policy_list) { +} + +DummyConfigurationPolicyProvider::~DummyConfigurationPolicyProvider() { +} + +bool DummyConfigurationPolicyProvider::Provide( + ConfigurationPolicyStoreInterface* store) { + return true; +} + +} // namespace policy diff --git a/chrome/browser/policy/dummy_configuration_policy_provider.h b/chrome/browser/policy/dummy_configuration_policy_provider.h index 2c519cb..a26ec71 100644 --- a/chrome/browser/policy/dummy_configuration_policy_provider.h +++ b/chrome/browser/policy/dummy_configuration_policy_provider.h @@ -6,22 +6,19 @@ #define CHROME_BROWSER_POLICY_DUMMY_CONFIGURATION_POLICY_PROVIDER_H_ #pragma once -#include "chrome/browser/policy/configuration_policy_store_interface.h" #include "chrome/browser/policy/configuration_policy_provider.h" namespace policy { +class ConfigurationPolicyStoreInterface; + class DummyConfigurationPolicyProvider : public ConfigurationPolicyProvider { public: explicit DummyConfigurationPolicyProvider( - const PolicyDefinitionList* policy_list) - : ConfigurationPolicyProvider(policy_list) { - } - virtual ~DummyConfigurationPolicyProvider() {} - - virtual bool Provide(ConfigurationPolicyStoreInterface* store) { - return true; - } + const PolicyDefinitionList* policy_list); + virtual ~DummyConfigurationPolicyProvider(); + + virtual bool Provide(ConfigurationPolicyStoreInterface* store); private: DISALLOW_COPY_AND_ASSIGN(DummyConfigurationPolicyProvider); diff --git a/chrome/browser/ppapi_plugin_process_host.cc b/chrome/browser/ppapi_plugin_process_host.cc index afd5a80..b9be47a 100644 --- a/chrome/browser/ppapi_plugin_process_host.cc +++ b/chrome/browser/ppapi_plugin_process_host.cc @@ -62,6 +62,10 @@ void PpapiPluginProcessHost::Init(const FilePath& path, cmd_line); } +bool PpapiPluginProcessHost::CanShutdown() { + return true; +} + void PpapiPluginProcessHost::OnProcessLaunched() { } diff --git a/chrome/browser/ppapi_plugin_process_host.h b/chrome/browser/ppapi_plugin_process_host.h index 3981689..23be5da 100644 --- a/chrome/browser/ppapi_plugin_process_host.h +++ b/chrome/browser/ppapi_plugin_process_host.h @@ -20,7 +20,7 @@ class PpapiPluginProcessHost : public BrowserChildProcessHost { void Init(const FilePath& path, IPC::Message* reply_msg); private: - virtual bool CanShutdown() { return true; } + virtual bool CanShutdown(); virtual void OnProcessLaunched(); virtual void OnMessageReceived(const IPC::Message& msg); diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc index 4000e8b..14aac20 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service.cc +++ b/chrome/browser/safe_browsing/client_side_detection_service.cc @@ -32,6 +32,11 @@ const char ClientSideDetectionService::kClientReportPhishingUrl[] = const char ClientSideDetectionService::kClientModelUrl[] = "https://ssl.gstatic.com/safebrowsing/csd/client_model_v0.pb"; +struct ClientSideDetectionService::ClientReportInfo { + scoped_ptr<ClientReportPhishingRequestCallback> callback; + GURL phishing_url; +}; + ClientSideDetectionService::ClientSideDetectionService( const FilePath& model_path, URLRequestContextGetter* request_context_getter) diff --git a/chrome/browser/safe_browsing/client_side_detection_service.h b/chrome/browser/safe_browsing/client_side_detection_service.h index 9f1ca39..41c87f6 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service.h +++ b/chrome/browser/safe_browsing/client_side_detection_service.h @@ -97,11 +97,6 @@ class ClientSideDetectionService : public URLFetcher::Delegate { ERROR_STATUS, }; - struct ClientReportInfo { - scoped_ptr<ClientReportPhishingRequestCallback> callback; - GURL phishing_url; - }; - static const char kClientReportPhishingUrl[]; static const char kClientModelUrl[]; @@ -177,6 +172,7 @@ class ClientSideDetectionService : public URLFetcher::Delegate { // Map of client report phishing request to the corresponding callback that // has to be invoked when the request is done. + struct ClientReportInfo; std::map<const URLFetcher*, ClientReportInfo*> client_phishing_reports_; // Used to asynchronously call the callbacks for GetModelFile and diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.cc b/chrome/browser/sync/glue/bookmark_data_type_controller.cc index c8949d0..26a02f4 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller.cc @@ -88,6 +88,27 @@ void BookmarkDataTypeController::Stop() { state_ = NOT_RUNNING; } +bool BookmarkDataTypeController::enabled() { + return true; +} + +syncable::ModelType BookmarkDataTypeController::type() { + return syncable::BOOKMARKS; +} + +browser_sync::ModelSafeGroup BookmarkDataTypeController::model_safe_group() { + return browser_sync::GROUP_UI; +} + +const char* BookmarkDataTypeController::name() const { + // For logging only. + return "bookmark"; +} + +DataTypeController::State BookmarkDataTypeController::state() { + return state_; +} + void BookmarkDataTypeController::OnUnrecoverableError( const tracked_objects::Location& from_here, const std::string& message) { // The ProfileSyncService will invoke our Stop() method in response to this. diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.h b/chrome/browser/sync/glue/bookmark_data_type_controller.h index 41068c8..0716b44 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller.h +++ b/chrome/browser/sync/glue/bookmark_data_type_controller.h @@ -41,26 +41,15 @@ class BookmarkDataTypeController : public DataTypeController, virtual void Stop(); - virtual bool enabled() { - return true; - } - - virtual syncable::ModelType type() { - return syncable::BOOKMARKS; - } - - virtual browser_sync::ModelSafeGroup model_safe_group() { - return browser_sync::GROUP_UI; - } - - virtual const char* name() const { - // For logging only. - return "bookmark"; - } - - virtual State state() { - return state_; - } + virtual bool enabled(); + + virtual syncable::ModelType type(); + + virtual browser_sync::ModelSafeGroup model_safe_group(); + + virtual const char* name() const; + + virtual State state(); // UnrecoverableErrorHandler interface. virtual void OnUnrecoverableError(const tracked_objects::Location& from_here, diff --git a/chrome/browser/sync/glue/data_type_manager_impl.cc b/chrome/browser/sync/glue/data_type_manager_impl.cc index 119a616..0177e66 100644 --- a/chrome/browser/sync/glue/data_type_manager_impl.cc +++ b/chrome/browser/sync/glue/data_type_manager_impl.cc @@ -340,6 +340,14 @@ void DataTypeManagerImpl::Stop() { FinishStop(); } +const DataTypeController::TypeMap& DataTypeManagerImpl::controllers() { + return controllers_; +} + +DataTypeManager::State DataTypeManagerImpl::state() { + return state_; +} + void DataTypeManagerImpl::FinishStop() { DCHECK(state_== CONFIGURING || state_ == STOPPING || diff --git a/chrome/browser/sync/glue/data_type_manager_impl.h b/chrome/browser/sync/glue/data_type_manager_impl.h index a735394..93d000a 100644 --- a/chrome/browser/sync/glue/data_type_manager_impl.h +++ b/chrome/browser/sync/glue/data_type_manager_impl.h @@ -37,13 +37,9 @@ class DataTypeManagerImpl : public DataTypeManager, virtual void Stop(); - virtual const DataTypeController::TypeMap& controllers() { - return controllers_; - }; + virtual const DataTypeController::TypeMap& controllers(); - virtual State state() { - return state_; - } + virtual State state(); // NotificationObserver implementation. virtual void Observe(NotificationType type, diff --git a/chrome/browser/sync/glue/database_model_worker.cc b/chrome/browser/sync/glue/database_model_worker.cc index 9bc83d5..b09c6c6 100644 --- a/chrome/browser/sync/glue/database_model_worker.cc +++ b/chrome/browser/sync/glue/database_model_worker.cc @@ -34,6 +34,10 @@ void DatabaseModelWorker::CallDoWorkAndSignalTask(Callback0::Type* work, done->Signal(); } +ModelSafeGroup DatabaseModelWorker::GetModelSafeGroup() { + return GROUP_DB; +} + bool DatabaseModelWorker::CurrentThreadIsWorkThread() { return BrowserThread::CurrentlyOn(BrowserThread::DB); } diff --git a/chrome/browser/sync/glue/database_model_worker.h b/chrome/browser/sync/glue/database_model_worker.h index 5b3a6997..6d6a873 100644 --- a/chrome/browser/sync/glue/database_model_worker.h +++ b/chrome/browser/sync/glue/database_model_worker.h @@ -23,7 +23,7 @@ class DatabaseModelWorker : public browser_sync::ModelSafeWorker { // ModelSafeWorker implementation. Called on syncapi SyncerThread. virtual void DoWorkAndWaitUntilDone(Callback0::Type* work); - virtual ModelSafeGroup GetModelSafeGroup() { return GROUP_DB; } + virtual ModelSafeGroup GetModelSafeGroup(); virtual bool CurrentThreadIsWorkThread(); private: diff --git a/chrome/browser/sync/glue/extension_data_type_controller.cc b/chrome/browser/sync/glue/extension_data_type_controller.cc index b31ae4e..0f67690 100644 --- a/chrome/browser/sync/glue/extension_data_type_controller.cc +++ b/chrome/browser/sync/glue/extension_data_type_controller.cc @@ -84,6 +84,27 @@ void ExtensionDataTypeController::Stop() { state_ = NOT_RUNNING; } +bool ExtensionDataTypeController::enabled() { + return true; +} + +syncable::ModelType ExtensionDataTypeController::type() { + return syncable::EXTENSIONS; +} + +browser_sync::ModelSafeGroup ExtensionDataTypeController::model_safe_group() { + return browser_sync::GROUP_UI; +} + +const char* ExtensionDataTypeController::name() const { + // For logging only. + return "extension"; +} + +DataTypeController::State ExtensionDataTypeController::state() { + return state_; +} + void ExtensionDataTypeController::OnUnrecoverableError( const tracked_objects::Location& from_here, const std::string& message) { diff --git a/chrome/browser/sync/glue/extension_data_type_controller.h b/chrome/browser/sync/glue/extension_data_type_controller.h index 61f1d78..0c031df 100644 --- a/chrome/browser/sync/glue/extension_data_type_controller.h +++ b/chrome/browser/sync/glue/extension_data_type_controller.h @@ -34,26 +34,15 @@ class ExtensionDataTypeController : public DataTypeController { virtual void Stop(); - virtual bool enabled() { - return true; - } - - virtual syncable::ModelType type() { - return syncable::EXTENSIONS; - } - - virtual browser_sync::ModelSafeGroup model_safe_group() { - return browser_sync::GROUP_UI; - } - - virtual const char* name() const { - // For logging only. - return "extension"; - } - - virtual State state() { - return state_; - } + virtual bool enabled(); + + virtual syncable::ModelType type(); + + virtual browser_sync::ModelSafeGroup model_safe_group(); + + virtual const char* name() const; + + virtual State state(); // UnrecoverableErrorHandler interface. virtual void OnUnrecoverableError( diff --git a/chrome/browser/sync/glue/history_model_worker.cc b/chrome/browser/sync/glue/history_model_worker.cc index bb1ac93..9b0ea509 100644 --- a/chrome/browser/sync/glue/history_model_worker.cc +++ b/chrome/browser/sync/glue/history_model_worker.cc @@ -50,6 +50,10 @@ void HistoryModelWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) { done.Wait(); } +ModelSafeGroup HistoryModelWorker::GetModelSafeGroup() { + return GROUP_HISTORY; +} + bool HistoryModelWorker::CurrentThreadIsWorkThread() { // TODO(ncarter): How to determine this? return true; diff --git a/chrome/browser/sync/glue/history_model_worker.h b/chrome/browser/sync/glue/history_model_worker.h index 32d45dc..bdd0a2c 100644 --- a/chrome/browser/sync/glue/history_model_worker.h +++ b/chrome/browser/sync/glue/history_model_worker.h @@ -31,7 +31,7 @@ class HistoryModelWorker : public browser_sync::ModelSafeWorker, // ModelSafeWorker implementation. Called on syncapi SyncerThread. virtual void DoWorkAndWaitUntilDone(Callback0::Type* work); - virtual ModelSafeGroup GetModelSafeGroup() { return GROUP_HISTORY; } + virtual ModelSafeGroup GetModelSafeGroup(); virtual bool CurrentThreadIsWorkThread(); // CancelableRequestConsumerBase implementation. diff --git a/chrome/browser/sync/glue/password_model_worker.cc b/chrome/browser/sync/glue/password_model_worker.cc index f832ac1..c06f33f 100644 --- a/chrome/browser/sync/glue/password_model_worker.cc +++ b/chrome/browser/sync/glue/password_model_worker.cc @@ -35,6 +35,10 @@ void PasswordModelWorker::CallDoWorkAndSignalTask(Callback0::Type* work, done->Signal(); } +ModelSafeGroup PasswordModelWorker::GetModelSafeGroup() { + return GROUP_PASSWORD; +} + bool PasswordModelWorker::CurrentThreadIsWorkThread() { // TODO(ncarter): How to determine this? return true; diff --git a/chrome/browser/sync/glue/password_model_worker.h b/chrome/browser/sync/glue/password_model_worker.h index d88a456..7ef537a 100644 --- a/chrome/browser/sync/glue/password_model_worker.h +++ b/chrome/browser/sync/glue/password_model_worker.h @@ -30,7 +30,7 @@ class PasswordModelWorker : public browser_sync::ModelSafeWorker { // ModelSafeWorker implementation. Called on syncapi SyncerThread. virtual void DoWorkAndWaitUntilDone(Callback0::Type* work); - virtual ModelSafeGroup GetModelSafeGroup() { return GROUP_PASSWORD; } + virtual ModelSafeGroup GetModelSafeGroup(); virtual bool CurrentThreadIsWorkThread(); private: diff --git a/chrome/browser/sync/glue/preference_data_type_controller.cc b/chrome/browser/sync/glue/preference_data_type_controller.cc index f714ed1..d5c09cf 100644 --- a/chrome/browser/sync/glue/preference_data_type_controller.cc +++ b/chrome/browser/sync/glue/preference_data_type_controller.cc @@ -86,6 +86,27 @@ void PreferenceDataTypeController::Stop() { state_ = NOT_RUNNING; } +bool PreferenceDataTypeController::enabled() { + return true; +} + +syncable::ModelType PreferenceDataTypeController::type() { + return syncable::PREFERENCES; +} + +browser_sync::ModelSafeGroup PreferenceDataTypeController::model_safe_group() { + return browser_sync::GROUP_UI; +} + +const char* PreferenceDataTypeController::name() const { + // For logging only. + return "preference"; +} + +DataTypeController::State PreferenceDataTypeController::state() { + return state_; +} + void PreferenceDataTypeController::OnUnrecoverableError( const tracked_objects::Location& from_here, const std::string& message) { diff --git a/chrome/browser/sync/glue/preference_data_type_controller.h b/chrome/browser/sync/glue/preference_data_type_controller.h index bc2b93d..4fc177d 100644 --- a/chrome/browser/sync/glue/preference_data_type_controller.h +++ b/chrome/browser/sync/glue/preference_data_type_controller.h @@ -29,26 +29,15 @@ class PreferenceDataTypeController : public DataTypeController { virtual void Stop(); - virtual bool enabled() { - return true; - } - - virtual syncable::ModelType type() { - return syncable::PREFERENCES; - } - - virtual browser_sync::ModelSafeGroup model_safe_group() { - return browser_sync::GROUP_UI; - } - - virtual const char* name() const { - // For logging only. - return "preference"; - } - - virtual State state() { - return state_; - } + virtual bool enabled(); + + virtual syncable::ModelType type(); + + virtual browser_sync::ModelSafeGroup model_safe_group(); + + virtual const char* name() const; + + virtual State state(); // UnrecoverableErrorHandler interface. virtual void OnUnrecoverableError(const tracked_objects::Location& from_here, diff --git a/chrome/browser/sync/glue/preference_model_associator.cc b/chrome/browser/sync/glue/preference_model_associator.cc index da6ca37..e9fcfdf 100644 --- a/chrome/browser/sync/glue/preference_model_associator.cc +++ b/chrome/browser/sync/glue/preference_model_associator.cc @@ -165,6 +165,17 @@ bool PreferenceModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) { return true; } +const PrefService::Preference* +PreferenceModelAssociator::GetChromeNodeFromSyncId(int64 sync_id) { + return NULL; +} + +bool PreferenceModelAssociator::InitSyncNodeFromChromeId( + const std::string& node_id, + sync_api::BaseNode* sync_node) { + return false; +} + int64 PreferenceModelAssociator::GetSyncIdFromChromeId( const std::string& preference_name) { PreferenceNameToSyncIdMap::const_iterator iter = diff --git a/chrome/browser/sync/glue/preference_model_associator.h b/chrome/browser/sync/glue/preference_model_associator.h index 444c03a..f50bb2c 100644 --- a/chrome/browser/sync/glue/preference_model_associator.h +++ b/chrome/browser/sync/glue/preference_model_associator.h @@ -70,16 +70,11 @@ class PreferenceModelAssociator } // Not implemented. - virtual const PrefService::Preference* GetChromeNodeFromSyncId( - int64 sync_id) { - return NULL; - } + virtual const PrefService::Preference* GetChromeNodeFromSyncId(int64 sync_id); // Not implemented. virtual bool InitSyncNodeFromChromeId(const std::string& node_id, - sync_api::BaseNode* sync_node) { - return false; - } + sync_api::BaseNode* sync_node); // Returns the sync id for the given preference name, or sync_api::kInvalidId // if the preference name is not associated to any sync id. diff --git a/chrome/browser/sync/glue/session_data_type_controller.cc b/chrome/browser/sync/glue/session_data_type_controller.cc index 8b68972..162891c 100644 --- a/chrome/browser/sync/glue/session_data_type_controller.cc +++ b/chrome/browser/sync/glue/session_data_type_controller.cc @@ -82,6 +82,27 @@ void SessionDataTypeController::Stop() { state_ = NOT_RUNNING; } +bool SessionDataTypeController::enabled() { + return true; +} + +syncable::ModelType SessionDataTypeController::type() { + return syncable::SESSIONS; +} + +browser_sync::ModelSafeGroup SessionDataTypeController::model_safe_group() { + return browser_sync::GROUP_UI; +} + +const char* SessionDataTypeController::name() const { + // For logging only. + return "session"; +} + +DataTypeController::State SessionDataTypeController::state() { + return state_; +} + void SessionDataTypeController::OnUnrecoverableError( const tracked_objects::Location& from_here, const std::string& message) { diff --git a/chrome/browser/sync/glue/session_data_type_controller.h b/chrome/browser/sync/glue/session_data_type_controller.h index ae815d4..8736789 100644 --- a/chrome/browser/sync/glue/session_data_type_controller.h +++ b/chrome/browser/sync/glue/session_data_type_controller.h @@ -33,33 +33,22 @@ class SessionDataTypeController : public DataTypeController { virtual void Stop(); - virtual bool enabled() { - return true; - } + virtual bool enabled(); - virtual syncable::ModelType type() { - return syncable::SESSIONS; - } + virtual syncable::ModelType type(); - virtual browser_sync::ModelSafeGroup model_safe_group() { - return browser_sync::GROUP_UI; - } + virtual browser_sync::ModelSafeGroup model_safe_group(); - virtual const char* name() const { - // For logging only. - return "session"; - } + virtual const char* name() const; - virtual State state() { - return state_; - } + virtual State state(); // UnrecoverableErrorHandler interface. virtual void OnUnrecoverableError( const tracked_objects::Location& from_here, const std::string& message); -SessionModelAssociator* GetModelAssociator(); + SessionModelAssociator* GetModelAssociator(); private: // Helper method to run the stashed start callback with a given result. diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index 2219523..2a4780f 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -33,7 +33,6 @@ #include "chrome/common/notification_service.h" #include "grit/browser_resources.h" #include "net/base/escape.h" -#include "views/window/window_delegate.h" using WebKit::WebDragOperation; using WebKit::WebDragOperationsMask; diff --git a/chrome/browser/tab_contents/render_view_context_menu_gtk.cc b/chrome/browser/tab_contents/render_view_context_menu_gtk.cc index 120ea9e..4c2a6d3 100644 --- a/chrome/browser/tab_contents/render_view_context_menu_gtk.cc +++ b/chrome/browser/tab_contents/render_view_context_menu_gtk.cc @@ -34,6 +34,12 @@ void RenderViewContextMenuGtk::PlatformInit() { } } +bool RenderViewContextMenuGtk::GetAcceleratorForCommandId( + int command_id, + menus::Accelerator* accelerator) { + return false; +} + void RenderViewContextMenuGtk::Popup(const gfx::Point& point) { RenderWidgetHostView* rwhv = source_tab_contents_->GetRenderWidgetHostView(); if (rwhv) diff --git a/chrome/browser/tab_contents/render_view_context_menu_gtk.h b/chrome/browser/tab_contents/render_view_context_menu_gtk.h index 863e21e..f9da630 100644 --- a/chrome/browser/tab_contents/render_view_context_menu_gtk.h +++ b/chrome/browser/tab_contents/render_view_context_menu_gtk.h @@ -35,9 +35,7 @@ class RenderViewContextMenuGtk : public RenderViewContextMenu, // TODO(port): implement. virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { - return false; - } + menus::Accelerator* accelerator); private: scoped_ptr<MenuGtk> menu_gtk_; diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc index 47819e3..40a23b2 100644 --- a/chrome/browser/task_manager/task_manager_resource_providers.cc +++ b/chrome/browser/task_manager/task_manager_resource_providers.cc @@ -134,6 +134,22 @@ base::ProcessHandle TaskManagerRendererResource::GetProcess() const { return process_; } +TaskManager::Resource::Type TaskManagerRendererResource::GetType() const { + return RENDERER; +} + +bool TaskManagerRendererResource::ReportsCacheStats() const { + return true; +} + +bool TaskManagerRendererResource::ReportsV8MemoryStats() const { + return true; +} + +bool TaskManagerRendererResource::SupportNetworkUsage() const { + return true; +} + //////////////////////////////////////////////////////////////////////////////// // TaskManagerTabContentsResource class //////////////////////////////////////////////////////////////////////////////// @@ -888,6 +904,19 @@ base::ProcessHandle TaskManagerExtensionProcessResource::GetProcess() const { return process_handle_; } +TaskManager::Resource::Type +TaskManagerExtensionProcessResource::GetType() const { + return EXTENSION; +} + +bool TaskManagerExtensionProcessResource::SupportNetworkUsage() const { + return true; +} + +void TaskManagerExtensionProcessResource::SetSupportNetworkUsage() { + NOTREACHED(); +} + const Extension* TaskManagerExtensionProcessResource::GetExtension() const { return extension_host_->extension(); } @@ -1062,6 +1091,10 @@ TaskManagerNotificationResource::TaskManagerNotificationResource( TaskManagerNotificationResource::~TaskManagerNotificationResource() { } +std::wstring TaskManagerNotificationResource::GetTitle() const { + return title_; +} + SkBitmap TaskManagerNotificationResource::GetIcon() const { return *default_icon_; } @@ -1070,6 +1103,14 @@ base::ProcessHandle TaskManagerNotificationResource::GetProcess() const { return process_handle_; } +TaskManager::Resource::Type TaskManagerNotificationResource::GetType() const { + return NOTIFICATION; +} + +bool TaskManagerNotificationResource::SupportNetworkUsage() const { + return false; +} + //////////////////////////////////////////////////////////////////////////////// // TaskManagerNotificationResourceProvider class //////////////////////////////////////////////////////////////////////////////// @@ -1239,6 +1280,22 @@ base::ProcessHandle TaskManagerBrowserProcessResource::GetProcess() const { return base::GetCurrentProcessHandle(); // process_; } +TaskManager::Resource::Type TaskManagerBrowserProcessResource::GetType() const { + return BROWSER; +} + +bool TaskManagerBrowserProcessResource::SupportNetworkUsage() const { + return true; +} + +void TaskManagerBrowserProcessResource::SetSupportNetworkUsage() { + NOTREACHED(); +} + +bool TaskManagerBrowserProcessResource::ReportsSqliteMemoryUsed() const { + return true; +} + //////////////////////////////////////////////////////////////////////////////// // TaskManagerBrowserProcessResourceProvider class //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/task_manager/task_manager_resource_providers.h b/chrome/browser/task_manager/task_manager_resource_providers.h index cf29bc2..b43a2d3 100644 --- a/chrome/browser/task_manager/task_manager_resource_providers.h +++ b/chrome/browser/task_manager/task_manager_resource_providers.h @@ -36,15 +36,15 @@ class TaskManagerRendererResource : public TaskManager::Resource { // TaskManager::Resource methods: virtual base::ProcessHandle GetProcess() const; - virtual Type GetType() const { return RENDERER; } - virtual bool ReportsCacheStats() const { return true; } + virtual Type GetType() const; + virtual bool ReportsCacheStats() const; virtual WebKit::WebCache::ResourceTypeStats GetWebCoreCacheStats() const; - virtual bool ReportsV8MemoryStats() const { return true; } + virtual bool ReportsV8MemoryStats() const; virtual size_t GetV8MemoryAllocated() const; virtual size_t GetV8MemoryUsed() const; // RenderResources always provide the network usage. - virtual bool SupportNetworkUsage() const { return true; } + virtual bool SupportNetworkUsage() const; virtual void SetSupportNetworkUsage() { } virtual void Refresh(); @@ -298,9 +298,9 @@ class TaskManagerExtensionProcessResource : public TaskManager::Resource { virtual std::wstring GetTitle() const; virtual SkBitmap GetIcon() const; virtual base::ProcessHandle GetProcess() const; - virtual Type GetType() const { return EXTENSION; } - virtual bool SupportNetworkUsage() const { return true; } - virtual void SetSupportNetworkUsage() { NOTREACHED(); } + virtual Type GetType() const; + virtual bool SupportNetworkUsage() const; + virtual void SetSupportNetworkUsage(); virtual const Extension* GetExtension() const; // Returns the pid of the extension process. @@ -370,11 +370,11 @@ class TaskManagerNotificationResource : public TaskManager::Resource { virtual ~TaskManagerNotificationResource(); // TaskManager::Resource interface - virtual std::wstring GetTitle() const { return title_; } + virtual std::wstring GetTitle() const; virtual SkBitmap GetIcon() const; virtual base::ProcessHandle GetProcess() const; - virtual Type GetType() const { return NOTIFICATION; } - virtual bool SupportNetworkUsage() const { return false; } + virtual Type GetType() const; + virtual bool SupportNetworkUsage() const; virtual void SetSupportNetworkUsage() { } private: @@ -438,12 +438,12 @@ class TaskManagerBrowserProcessResource : public TaskManager::Resource { virtual std::wstring GetTitle() const; virtual SkBitmap GetIcon() const; virtual base::ProcessHandle GetProcess() const; - virtual Type GetType() const { return BROWSER; } + virtual Type GetType() const; - virtual bool SupportNetworkUsage() const { return true; } - virtual void SetSupportNetworkUsage() { NOTREACHED(); } + virtual bool SupportNetworkUsage() const; + virtual void SetSupportNetworkUsage(); - virtual bool ReportsSqliteMemoryUsed() const { return true; } + virtual bool ReportsSqliteMemoryUsed() const; virtual size_t SqliteMemoryUsedBytes() const; // Returns the pid of the browser process. diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc index c4c8a7e..034e0a0 100644 --- a/chrome/browser/ui/views/notifications/balloon_view.cc +++ b/chrome/browser/ui/views/notifications/balloon_view.cc @@ -131,6 +131,10 @@ gfx::Size BalloonViewImpl::GetSize() const { return gfx::Size(GetTotalWidth(), GetTotalHeight()); } +BalloonHost* BalloonViewImpl::GetHost() const { + return html_contents_.get(); +} + void BalloonViewImpl::RunMenu(views::View* source, const gfx::Point& pt) { RunOptionsMenu(pt); } @@ -166,6 +170,10 @@ void BalloonViewImpl::DidChangeBounds(const gfx::Rect& previous, SizeContentsWindow(); } +gfx::Size BalloonViewImpl::GetPreferredSize() { + return gfx::Size(1000, 1000); +} + void BalloonViewImpl::SizeContentsWindow() { if (!html_container_ || !frame_container_) return; diff --git a/chrome/browser/ui/views/notifications/balloon_view.h b/chrome/browser/ui/views/notifications/balloon_view.h index 9bcea0e..c069a0a 100644 --- a/chrome/browser/ui/views/notifications/balloon_view.h +++ b/chrome/browser/ui/views/notifications/balloon_view.h @@ -59,16 +59,14 @@ class BalloonViewImpl : public BalloonView, virtual void RepositionToBalloon(); virtual void Close(bool by_user); virtual gfx::Size GetSize() const; - virtual BalloonHost* GetHost() const { return html_contents_.get(); } + virtual BalloonHost* GetHost() const; private: // views::View interface. virtual void Paint(gfx::Canvas* canvas); virtual void DidChangeBounds(const gfx::Rect& previous, const gfx::Rect& current); - virtual gfx::Size GetPreferredSize() { - return gfx::Size(1000, 1000); - } + virtual gfx::Size GetPreferredSize(); // views::ViewMenuDelegate interface. virtual void RunMenu(views::View* source, const gfx::Point& pt); diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.cc b/chrome/browser/ui/views/notifications/balloon_view_host.cc index 24a7fe2..ddc59c8 100644 --- a/chrome/browser/ui/views/notifications/balloon_view_host.cc +++ b/chrome/browser/ui/views/notifications/balloon_view_host.cc @@ -90,3 +90,7 @@ void BalloonViewHost::InitRenderWidgetHostView() { NOTIMPLEMENTED(); #endif } + +RenderWidgetHostView* BalloonViewHost::render_widget_host_view() const { + return render_widget_host_view_; +} diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.h b/chrome/browser/ui/views/notifications/balloon_view_host.h index a2f6663..23f82b9 100644 --- a/chrome/browser/ui/views/notifications/balloon_view_host.h +++ b/chrome/browser/ui/views/notifications/balloon_view_host.h @@ -39,9 +39,7 @@ class BalloonViewHost : public BalloonHost { protected: virtual void InitRenderWidgetHostView(); - virtual RenderWidgetHostView* render_widget_host_view() const { - return render_widget_host_view_; - } + virtual RenderWidgetHostView* render_widget_host_view() const; private: // The platform-specific widget host view. Pointer is owned by the RVH. |