Skip to content

Commit

Permalink
Almost done deinlining virtual methods.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
erg@google.com committed Dec 16, 2010
1 parent 0c5f45a commit 1e60547
Show file tree
Hide file tree
Showing 80 changed files with 553 additions and 203 deletions.
22 changes: 22 additions & 0 deletions chrome/browser/automation/ui_controls_internal.cc
Original file line number Diff line number Diff line change
@@ -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
15 changes: 3 additions & 12 deletions chrome/browser/automation/ui_controls_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/device_orientation/data_fetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class DataFetcher {
public:
virtual ~DataFetcher() {}
virtual bool GetOrientation(Orientation*) = 0;
virtual int MinSamplingIntervalMs() const { return 0; }
};

} // namespace device_orientation
Expand Down
10 changes: 4 additions & 6 deletions chrome/browser/device_orientation/provider_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion chrome/browser/dom_ui/bug_report_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
22 changes: 22 additions & 0 deletions chrome/browser/extensions/extension_tts_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
15 changes: 5 additions & 10 deletions chrome/browser/extensions/extension_tts_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand All @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/gpu_blacklist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -214,6 +216,8 @@ GpuBlacklist::GpuBlacklistEntry::GetGpuBlacklistEntryFromValue(
return entry;
}

GpuBlacklist::GpuBlacklistEntry::~GpuBlacklistEntry() {}

GpuBlacklist::GpuBlacklistEntry::GpuBlacklistEntry()
: vendor_id_(0),
device_id_(0) {
Expand Down
3 changes: 3 additions & 0 deletions chrome/browser/gpu_blacklist.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -150,6 +151,8 @@ class GpuBlacklist {
// Returns the GpuFeatureFlags.
GpuFeatureFlags GetGpuFeatureFlags() const;

~GpuBlacklistEntry();

private:
GpuBlacklistEntry();

Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/gtk/first_run_bubble.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/gtk/first_run_bubble.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/gtk/notifications/balloon_view_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_) {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/gtk/notifications/balloon_view_gtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/modal_html_dialog_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion chrome/browser/modal_html_dialog_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down
22 changes: 22 additions & 0 deletions chrome/browser/policy/dummy_configuration_policy_provider.cc
Original file line number Diff line number Diff line change
@@ -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
15 changes: 6 additions & 9 deletions chrome/browser/policy/dummy_configuration_policy_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/ppapi_plugin_process_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ void PpapiPluginProcessHost::Init(const FilePath& path,
cmd_line);
}

bool PpapiPluginProcessHost::CanShutdown() {
return true;
}

void PpapiPluginProcessHost::OnProcessLaunched() {
}

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ppapi_plugin_process_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/safe_browsing/client_side_detection_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions chrome/browser/safe_browsing/client_side_detection_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -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[];

Expand Down Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions chrome/browser/sync/glue/bookmark_data_type_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 1e60547

Please sign in to comment.