summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autocomplete/autocomplete.cc36
-rw-r--r--chrome/browser/autocomplete/autocomplete.h25
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.cc27
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.h13
-rw-r--r--chrome/browser/automation/automation_resource_routing_delegate.cc19
-rw-r--r--chrome/browser/automation/automation_resource_routing_delegate.h8
-rw-r--r--chrome/browser/browser.cc4
-rw-r--r--chrome/browser/browser.h2
-rw-r--r--chrome/browser/command_updater.cc6
-rw-r--r--chrome/browser/command_updater.h4
-rw-r--r--chrome/browser/extensions/extension_function.cc37
-rw-r--r--chrome/browser/extensions/extension_function.h27
-rw-r--r--chrome/browser/pref_member.cc30
-rw-r--r--chrome/browser/pref_member.h20
-rw-r--r--chrome/browser/sessions/tab_restore_service.cc16
-rw-r--r--chrome/browser/sessions/tab_restore_service.h8
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc26
-rw-r--r--chrome/browser/tab_contents/tab_contents.h20
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.cc159
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.h107
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc60
-rw-r--r--chrome/browser/tabs/tab_strip_model.h30
-rw-r--r--chrome/chrome_browser.gypi3
23 files changed, 525 insertions, 162 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index a8a9e4e..d24e209 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -36,6 +36,13 @@ using base::TimeDelta;
// AutocompleteInput ----------------------------------------------------------
+AutocompleteInput::AutocompleteInput()
+ : type_(INVALID),
+ prevent_inline_autocomplete_(false),
+ prefer_keyword_(false),
+ synchronous_only_(false) {
+}
+
AutocompleteInput::AutocompleteInput(const std::wstring& text,
const std::wstring& desired_tld,
bool prevent_inline_autocomplete,
@@ -68,6 +75,9 @@ AutocompleteInput::AutocompleteInput(const std::wstring& text,
text_.erase(0, 1);
}
+AutocompleteInput::~AutocompleteInput() {
+}
+
// static
std::string AutocompleteInput::TypeToString(Type type) {
switch (type) {
@@ -407,6 +417,9 @@ AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider,
starred(false) {
}
+AutocompleteMatch::~AutocompleteMatch() {
+}
+
// static
std::string AutocompleteMatch::TypeToString(Type type) {
const char* strings[NUM_TYPES] = {
@@ -561,8 +574,16 @@ void AutocompleteMatch::ValidateClassifications(
// static
const size_t AutocompleteProvider::kMaxMatches = 3;
-AutocompleteProvider::~AutocompleteProvider() {
- Stop();
+AutocompleteProvider::ACProviderListener::~ACProviderListener() {
+}
+
+AutocompleteProvider::AutocompleteProvider(ACProviderListener* listener,
+ Profile* profile,
+ const char* name)
+ : profile_(profile),
+ listener_(listener),
+ done_(true),
+ name_(name) {
}
void AutocompleteProvider::SetProfile(Profile* profile) {
@@ -571,6 +592,17 @@ void AutocompleteProvider::SetProfile(Profile* profile) {
profile_ = profile;
}
+void AutocompleteProvider::Stop() {
+ done_ = true;
+}
+
+void AutocompleteProvider::DeleteMatch(const AutocompleteMatch& match) {
+}
+
+AutocompleteProvider::~AutocompleteProvider() {
+ Stop();
+}
+
// static
bool AutocompleteProvider::HasHTTPScheme(const std::wstring& input) {
std::string utf8_input(WideToUTF8(input));
diff --git a/chrome/browser/autocomplete/autocomplete.h b/chrome/browser/autocomplete/autocomplete.h
index 9cfb1b4..9ddec43 100644
--- a/chrome/browser/autocomplete/autocomplete.h
+++ b/chrome/browser/autocomplete/autocomplete.h
@@ -173,18 +173,13 @@ class AutocompleteInput {
FORCED_QUERY, // Input forced to be a query by an initial '?'
};
- AutocompleteInput()
- : type_(INVALID),
- prevent_inline_autocomplete_(false),
- prefer_keyword_(false),
- synchronous_only_(false) {
- }
-
+ AutocompleteInput();
AutocompleteInput(const std::wstring& text,
const std::wstring& desired_tld,
bool prevent_inline_autocomplete,
bool prefer_keyword,
bool synchronous_only);
+ ~AutocompleteInput();
// Converts |type| to a string representation. Used in logging.
static std::string TypeToString(Type type);
@@ -347,6 +342,7 @@ struct AutocompleteMatch {
int relevance,
bool deletable,
Type type);
+ ~AutocompleteMatch();
// Converts |type| to a string representation. Used in logging.
static std::string TypeToString(Type type);
@@ -491,17 +487,12 @@ class AutocompleteProvider
virtual void OnProviderUpdate(bool updated_matches) = 0;
protected:
- virtual ~ACProviderListener() {}
+ virtual ~ACProviderListener();
};
AutocompleteProvider(ACProviderListener* listener,
Profile* profile,
- const char* name)
- : profile_(profile),
- listener_(listener),
- done_(true),
- name_(name) {
- }
+ const char* name);
// Invoked when the profile changes.
// NOTE: Do not access any previous Profile* at this point as it may have
@@ -530,9 +521,7 @@ class AutocompleteProvider
// Called when a provider must not make any more callbacks for the current
// query. This will be called regardless of whether the provider is already
// done.
- virtual void Stop() {
- done_ = true;
- }
+ virtual void Stop();
// Returns the set of matches for the current query.
const ACMatches& matches() const { return matches_; }
@@ -548,7 +537,7 @@ class AutocompleteProvider
// called for matches the provider marks as deletable. This should only be
// called when no query is running.
// NOTE: Remember to call OnProviderUpdate() if matches_ is updated.
- virtual void DeleteMatch(const AutocompleteMatch& match) {}
+ virtual void DeleteMatch(const AutocompleteMatch& match);
// A suggested upper bound for how many matches a provider should return.
// TODO(pkasting): http://b/1111299 , http://b/933133 This should go away once
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc
index 32a4fec..03c8bff 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit.cc
@@ -30,6 +30,30 @@
#include "third_party/skia/include/core/SkBitmap.h"
///////////////////////////////////////////////////////////////////////////////
+// AutocompleteEditController
+
+AutocompleteEditController::~AutocompleteEditController() {
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// AutocompleteEditModel::State
+
+AutocompleteEditModel::State::State(bool user_input_in_progress,
+ const std::wstring& user_text,
+ const std::wstring& keyword,
+ bool is_keyword_hint,
+ KeywordUIState keyword_ui_state)
+ : user_input_in_progress(user_input_in_progress),
+ user_text(user_text),
+ keyword(keyword),
+ is_keyword_hint(is_keyword_hint),
+ keyword_ui_state(keyword_ui_state) {
+}
+
+AutocompleteEditModel::State::~State() {
+}
+
+///////////////////////////////////////////////////////////////////////////////
// AutocompleteEditModel
AutocompleteEditModel::AutocompleteEditModel(
@@ -52,6 +76,9 @@ AutocompleteEditModel::AutocompleteEditModel(
profile_(profile) {
}
+AutocompleteEditModel::~AutocompleteEditModel() {
+}
+
void AutocompleteEditModel::SetPopupModel(AutocompletePopupModel* popup_model) {
popup_ = popup_model;
registrar_.Add(this,
diff --git a/chrome/browser/autocomplete/autocomplete_edit.h b/chrome/browser/autocomplete/autocomplete_edit.h
index 5df61b4..1b9d03a 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.h
+++ b/chrome/browser/autocomplete/autocomplete_edit.h
@@ -61,7 +61,7 @@ class AutocompleteEditController {
virtual std::wstring GetTitle() const = 0;
protected:
- virtual ~AutocompleteEditController() {}
+ virtual ~AutocompleteEditController();
};
class AutocompleteEditModel : public NotificationObserver {
@@ -84,13 +84,8 @@ class AutocompleteEditModel : public NotificationObserver {
const std::wstring& user_text,
const std::wstring& keyword,
bool is_keyword_hint,
- KeywordUIState keyword_ui_state)
- : user_input_in_progress(user_input_in_progress),
- user_text(user_text),
- keyword(keyword),
- is_keyword_hint(is_keyword_hint),
- keyword_ui_state(keyword_ui_state) {
- }
+ KeywordUIState keyword_ui_state);
+ ~State();
bool user_input_in_progress;
const std::wstring user_text;
@@ -102,7 +97,7 @@ class AutocompleteEditModel : public NotificationObserver {
AutocompleteEditModel(AutocompleteEditView* view,
AutocompleteEditController* controller,
Profile* profile);
- ~AutocompleteEditModel() {}
+ ~AutocompleteEditModel();
void SetPopupModel(AutocompletePopupModel* popup_model);
diff --git a/chrome/browser/automation/automation_resource_routing_delegate.cc b/chrome/browser/automation/automation_resource_routing_delegate.cc
new file mode 100644
index 0000000..954b05e
--- /dev/null
+++ b/chrome/browser/automation/automation_resource_routing_delegate.cc
@@ -0,0 +1,19 @@
+// 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/automation_resource_routing_delegate.h"
+
+void AutomationResourceRoutingDelegate::RegisterRenderViewHost(
+ RenderViewHost* render_view_host) {
+}
+
+void AutomationResourceRoutingDelegate::UnregisterRenderViewHost(
+ RenderViewHost* render_view_host) {
+}
+
+AutomationResourceRoutingDelegate::AutomationResourceRoutingDelegate() {
+}
+
+AutomationResourceRoutingDelegate::~AutomationResourceRoutingDelegate() {
+}
diff --git a/chrome/browser/automation/automation_resource_routing_delegate.h b/chrome/browser/automation/automation_resource_routing_delegate.h
index 63c95de..2438e4d 100644
--- a/chrome/browser/automation/automation_resource_routing_delegate.h
+++ b/chrome/browser/automation/automation_resource_routing_delegate.h
@@ -15,14 +15,14 @@ class AutomationResourceRoutingDelegate {
public:
// Call to register |render_view_host| for resource routing automation
// by the delegate.
- virtual void RegisterRenderViewHost(RenderViewHost* render_view_host) {}
+ virtual void RegisterRenderViewHost(RenderViewHost* render_view_host);
// Call to unregister |render_view_host| from resource routing automation.
- virtual void UnregisterRenderViewHost(RenderViewHost* render_view_host) {}
+ virtual void UnregisterRenderViewHost(RenderViewHost* render_view_host);
protected:
- AutomationResourceRoutingDelegate() {}
- virtual ~AutomationResourceRoutingDelegate() {}
+ AutomationResourceRoutingDelegate();
+ virtual ~AutomationResourceRoutingDelegate();
private:
DISALLOW_COPY_AND_ASSIGN(AutomationResourceRoutingDelegate);
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index d04cb5d..c4a25df 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -2910,6 +2910,10 @@ void Browser::OnDidGetApplicationInfo(TabContents* tab_contents,
pending_web_app_action_ = NONE;
}
+Browser* Browser::GetBrowser() {
+ return this;
+}
+
///////////////////////////////////////////////////////////////////////////////
// Browser, SelectFileDialog::Listener implementation:
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 67ba3dd..6825a2c 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -730,7 +730,7 @@ class Browser : public TabStripModelDelegate,
virtual bool ShouldAddNavigationsToHistory() const;
virtual void OnDidGetApplicationInfo(TabContents* tab_contents,
int32 page_id);
- virtual Browser* GetBrowser() { return this; }
+ virtual Browser* GetBrowser();
// Overridden from SelectFileDialog::Listener:
virtual void FileSelected(const FilePath& path, int index, void* params);
diff --git a/chrome/browser/command_updater.cc b/chrome/browser/command_updater.cc
index efb0724..b55b09b 100644
--- a/chrome/browser/command_updater.cc
+++ b/chrome/browser/command_updater.cc
@@ -10,6 +10,9 @@
#include "base/observer_list.h"
#include "base/stl_util-inl.h"
+CommandUpdater::CommandUpdaterDelegate::~CommandUpdaterDelegate() {
+}
+
class CommandUpdater::Command {
public:
bool enabled;
@@ -42,6 +45,9 @@ void CommandUpdater::ExecuteCommand(int id) {
delegate_->ExecuteCommand(id);
}
+CommandUpdater::CommandObserver::~CommandObserver() {
+}
+
void CommandUpdater::UpdateCommandEnabled(int id, bool enabled) {
Command* command = GetCommand(id, true);
if (command->enabled == enabled)
diff --git a/chrome/browser/command_updater.h b/chrome/browser/command_updater.h
index e6e9557..bd30e84 100644
--- a/chrome/browser/command_updater.h
+++ b/chrome/browser/command_updater.h
@@ -26,7 +26,7 @@ class CommandUpdater {
virtual void ExecuteCommand(int id) = 0;
protected:
- virtual ~CommandUpdaterDelegate() {}
+ virtual ~CommandUpdaterDelegate();
};
// Create a CommandUpdater with a CommandUpdaterDelegate to handle execution
@@ -55,7 +55,7 @@ class CommandUpdater {
virtual void EnabledStateChangedForCommand(int id, bool enabled) = 0;
protected:
- virtual ~CommandObserver() {}
+ virtual ~CommandObserver();
};
// Adds an observer to the state of a particular command. If the command does
diff --git a/chrome/browser/extensions/extension_function.cc b/chrome/browser/extensions/extension_function.cc
index 437867f..6f5b100 100644
--- a/chrome/browser/extensions/extension_function.cc
+++ b/chrome/browser/extensions/extension_function.cc
@@ -10,12 +10,30 @@
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/profile.h"
+ExtensionFunction::ExtensionFunction()
+ : request_id_(-1), name_(""), has_callback_(false) {
+}
+
+ExtensionFunction::~ExtensionFunction() {
+}
+
Extension* ExtensionFunction::GetExtension() {
ExtensionsService* service = profile_->GetExtensionsService();
DCHECK(service);
return service->GetExtensionById(extension_id_, false);
}
+Browser* ExtensionFunction::GetCurrentBrowser() {
+ return dispatcher()->GetCurrentBrowser(include_incognito_);
+}
+
+AsyncExtensionFunction::AsyncExtensionFunction()
+ : args_(NULL), bad_message_(false) {
+}
+
+AsyncExtensionFunction::~AsyncExtensionFunction() {
+}
+
void AsyncExtensionFunction::SetArgs(const ListValue* args) {
DCHECK(!args_.get()); // Should only be called once.
args_.reset(static_cast<ListValue*>(args->DeepCopy()));
@@ -29,6 +47,15 @@ const std::string AsyncExtensionFunction::GetResult() {
return json;
}
+const std::string AsyncExtensionFunction::GetError() {
+ return error_;
+}
+
+void AsyncExtensionFunction::Run() {
+ if (!RunImpl())
+ SendResponse(false);
+}
+
void AsyncExtensionFunction::SendResponse(bool success) {
if (!dispatcher())
return;
@@ -43,3 +70,13 @@ bool AsyncExtensionFunction::HasOptionalArgument(size_t index) {
Value* value;
return args_->Get(index, &value) && !value->IsType(Value::TYPE_NULL);
}
+
+SyncExtensionFunction::SyncExtensionFunction() {
+}
+
+SyncExtensionFunction::~SyncExtensionFunction() {
+}
+
+void SyncExtensionFunction::Run() {
+ SendResponse(RunImpl());
+}
diff --git a/chrome/browser/extensions/extension_function.h b/chrome/browser/extensions/extension_function.h
index 27bd37c..a13845c 100644
--- a/chrome/browser/extensions/extension_function.h
+++ b/chrome/browser/extensions/extension_function.h
@@ -37,7 +37,7 @@ class QuotaLimitHeuristic;
// knows how to dispatch to.
class ExtensionFunction : public base::RefCountedThreadSafe<ExtensionFunction> {
public:
- ExtensionFunction() : request_id_(-1), name_(""), has_callback_(false) {}
+ ExtensionFunction();
// Specifies the name of the function.
void set_name(const std::string& name) { name_ = name; }
@@ -97,7 +97,7 @@ class ExtensionFunction : public base::RefCountedThreadSafe<ExtensionFunction> {
protected:
friend class base::RefCountedThreadSafe<ExtensionFunction>;
- virtual ~ExtensionFunction() {}
+ virtual ~ExtensionFunction();
// Gets the extension that called this function. This can return NULL for
// async functions, for example if the extension is unloaded while the
@@ -120,9 +120,7 @@ class ExtensionFunction : public base::RefCountedThreadSafe<ExtensionFunction> {
// This method can return NULL if there is no matching browser, which can
// happen if only incognito windows are open, or early in startup or shutdown
// shutdown when there are no active windows.
- Browser* GetCurrentBrowser() {
- return dispatcher()->GetCurrentBrowser(include_incognito_);
- }
+ Browser* GetCurrentBrowser();
// The peer to the dispatcher that will service this extension function call.
scoped_refptr<ExtensionFunctionDispatcher::Peer> peer_;
@@ -160,22 +158,19 @@ class ExtensionFunction : public base::RefCountedThreadSafe<ExtensionFunction> {
// parsing JSON (and instead uses custom serialization of Value objects).
class AsyncExtensionFunction : public ExtensionFunction {
public:
- AsyncExtensionFunction() : args_(NULL), bad_message_(false) {}
+ AsyncExtensionFunction();
virtual void SetArgs(const ListValue* args);
virtual const std::string GetResult();
- virtual const std::string GetError() { return error_; }
- virtual void Run() {
- if (!RunImpl())
- SendResponse(false);
- }
+ virtual const std::string GetError();
+ virtual void Run();
// Derived classes should implement this method to do their work and return
// success/failure.
virtual bool RunImpl() = 0;
protected:
- virtual ~AsyncExtensionFunction() {}
+ virtual ~AsyncExtensionFunction();
void SendResponse(bool success);
@@ -210,18 +205,16 @@ class AsyncExtensionFunction : public ExtensionFunction {
// need to interact with things on the browser UI thread.
class SyncExtensionFunction : public AsyncExtensionFunction {
public:
- SyncExtensionFunction() {}
+ SyncExtensionFunction();
// Derived classes should implement this method to do their work and return
// success/failure.
virtual bool RunImpl() = 0;
- virtual void Run() {
- SendResponse(RunImpl());
- }
+ virtual void Run();
protected:
- virtual ~SyncExtensionFunction() {}
+ virtual ~SyncExtensionFunction();
private:
DISALLOW_COPY_AND_ASSIGN(SyncExtensionFunction);
diff --git a/chrome/browser/pref_member.cc b/chrome/browser/pref_member.cc
index ea41df8..9502022 100644
--- a/chrome/browser/pref_member.cc
+++ b/chrome/browser/pref_member.cc
@@ -61,6 +61,12 @@ void PrefMemberBase::VerifyValuePrefName() {
} // namespace subtle
+BooleanPrefMember::BooleanPrefMember() : PrefMember<bool>() {
+}
+
+BooleanPrefMember::~BooleanPrefMember() {
+}
+
void BooleanPrefMember::UpdateValueFromPref() {
value_ = prefs()->GetBoolean(pref_name().c_str());
}
@@ -69,6 +75,12 @@ void BooleanPrefMember::UpdatePref(const bool& value) {
prefs()->SetBoolean(pref_name().c_str(), value);
}
+IntegerPrefMember::IntegerPrefMember() : PrefMember<int>() {
+}
+
+IntegerPrefMember::~IntegerPrefMember() {
+}
+
void IntegerPrefMember::UpdateValueFromPref() {
value_ = prefs()->GetInteger(pref_name().c_str());
}
@@ -77,6 +89,12 @@ void IntegerPrefMember::UpdatePref(const int& value) {
prefs()->SetInteger(pref_name().c_str(), value);
}
+RealPrefMember::RealPrefMember() : PrefMember<double>() {
+}
+
+RealPrefMember::~RealPrefMember() {
+}
+
void RealPrefMember::UpdateValueFromPref() {
value_ = prefs()->GetReal(pref_name().c_str());
}
@@ -85,6 +103,12 @@ void RealPrefMember::UpdatePref(const double& value) {
prefs()->SetReal(pref_name().c_str(), value);
}
+StringPrefMember::StringPrefMember() : PrefMember<std::string>() {
+}
+
+StringPrefMember::~StringPrefMember() {
+}
+
void StringPrefMember::UpdateValueFromPref() {
value_ = prefs()->GetString(pref_name().c_str());
}
@@ -93,6 +117,12 @@ void StringPrefMember::UpdatePref(const std::string& value) {
prefs()->SetString(pref_name().c_str(), value);
}
+FilePathPrefMember::FilePathPrefMember() : PrefMember<FilePath>() {
+}
+
+FilePathPrefMember::~FilePathPrefMember() {
+}
+
void FilePathPrefMember::UpdateValueFromPref() {
value_ = prefs()->GetFilePath(pref_name().c_str());
}
diff --git a/chrome/browser/pref_member.h b/chrome/browser/pref_member.h
index 2de76ab..1d84b6a 100644
--- a/chrome/browser/pref_member.h
+++ b/chrome/browser/pref_member.h
@@ -141,8 +141,8 @@ class PrefMember : public subtle::PrefMemberBase {
class BooleanPrefMember : public PrefMember<bool> {
public:
- BooleanPrefMember() : PrefMember<bool>() { }
- virtual ~BooleanPrefMember() { }
+ BooleanPrefMember();
+ virtual ~BooleanPrefMember();
protected:
virtual void UpdateValueFromPref();
@@ -154,8 +154,8 @@ class BooleanPrefMember : public PrefMember<bool> {
class IntegerPrefMember : public PrefMember<int> {
public:
- IntegerPrefMember() : PrefMember<int>() { }
- virtual ~IntegerPrefMember() { }
+ IntegerPrefMember();
+ virtual ~IntegerPrefMember();
protected:
virtual void UpdateValueFromPref();
@@ -167,8 +167,8 @@ class IntegerPrefMember : public PrefMember<int> {
class RealPrefMember : public PrefMember<double> {
public:
- RealPrefMember() : PrefMember<double>() { }
- virtual ~RealPrefMember() { }
+ RealPrefMember();
+ virtual ~RealPrefMember();
protected:
virtual void UpdateValueFromPref();
@@ -180,8 +180,8 @@ class RealPrefMember : public PrefMember<double> {
class StringPrefMember : public PrefMember<std::string> {
public:
- StringPrefMember() : PrefMember<std::string>() { }
- virtual ~StringPrefMember() { }
+ StringPrefMember();
+ virtual ~StringPrefMember();
protected:
virtual void UpdateValueFromPref();
@@ -193,8 +193,8 @@ class StringPrefMember : public PrefMember<std::string> {
class FilePathPrefMember : public PrefMember<FilePath> {
public:
- FilePathPrefMember() : PrefMember<FilePath>() { }
- virtual ~FilePathPrefMember() { }
+ FilePathPrefMember();
+ virtual ~FilePathPrefMember();
protected:
virtual void UpdateValueFromPref();
diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc
index 46f1859..720f3ae 100644
--- a/chrome/browser/sessions/tab_restore_service.cc
+++ b/chrome/browser/sessions/tab_restore_service.cc
@@ -24,6 +24,10 @@
using base::Time;
+// TimeFactory-----------------------------------------------------------------
+
+TabRestoreService::TimeFactory::~TimeFactory() {}
+
// Entry ----------------------------------------------------------------------
// ID of the next Entry.
@@ -39,6 +43,8 @@ TabRestoreService::Entry::Entry(Type type)
type(type),
from_last_session(false) {}
+TabRestoreService::Entry::~Entry() {}
+
// TabRestoreService ----------------------------------------------------------
// static
@@ -151,9 +157,15 @@ TabRestoreService::Tab::Tab()
pinned(false) {
}
+TabRestoreService::Tab::~Tab() {
+}
+
TabRestoreService::Window::Window() : Entry(WINDOW), selected_tab_index(-1) {
}
+TabRestoreService::Window::~Window() {
+}
+
TabRestoreService::TabRestoreService(Profile* profile,
TabRestoreService::TimeFactory* time_factory)
: BaseSessionService(BaseSessionService::TAB_RESTORE, profile,
@@ -260,6 +272,10 @@ void TabRestoreService::ClearEntries() {
NotifyTabsChanged();
}
+const TabRestoreService::Entries& TabRestoreService::entries() const {
+ return entries_;
+}
+
void TabRestoreService::RestoreMostRecentEntry(Browser* browser) {
if (entries_.empty())
return;
diff --git a/chrome/browser/sessions/tab_restore_service.h b/chrome/browser/sessions/tab_restore_service.h
index bab699a..6b98d15 100644
--- a/chrome/browser/sessions/tab_restore_service.h
+++ b/chrome/browser/sessions/tab_restore_service.h
@@ -48,7 +48,7 @@ class TabRestoreService : public BaseSessionService {
// Interface used to allow the test to provide a custom time.
class TimeFactory {
public:
- virtual ~TimeFactory() {}
+ virtual ~TimeFactory();
virtual base::Time TimeNow() = 0;
};
@@ -61,7 +61,7 @@ class TabRestoreService : public BaseSessionService {
struct Entry {
Entry();
explicit Entry(Type type);
- virtual ~Entry() {}
+ virtual ~Entry();
// Unique id for this entry. The id is guaranteed to be unique for a
// session.
@@ -82,6 +82,7 @@ class TabRestoreService : public BaseSessionService {
// Represents a previously open tab.
struct Tab : public Entry {
Tab();
+ virtual ~Tab();
bool has_browser() const { return browser_id > 0; }
@@ -108,6 +109,7 @@ class TabRestoreService : public BaseSessionService {
// Represents a previously open window.
struct Window : public Entry {
Window();
+ virtual ~Window();
// The tabs that comprised the window, in order.
std::vector<Tab> tabs;
@@ -147,7 +149,7 @@ class TabRestoreService : public BaseSessionService {
// Returns the entries, ordered with most recently closed entries at the
// front.
- virtual const Entries& entries() const { return entries_; }
+ virtual const Entries& entries() const;
// Restores the most recently closed entry. Does nothing if there are no
// entries to restore. If the most recently restored entry is a tab, it is
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index d3f2729..66306ae 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2855,6 +2855,16 @@ void TabContents::BeforeUnloadFiredFromRenderManager(
delegate()->BeforeUnloadFired(this, proceed, proceed_to_fire_unload);
}
+void TabContents::DidStartLoadingFromRenderManager(
+ RenderViewHost* render_view_host) {
+ DidStartLoading();
+}
+
+void TabContents::RenderViewGoneFromRenderManager(
+ RenderViewHost* render_view_host) {
+ RenderViewGone(render_view_host);
+}
+
void TabContents::UpdateRenderViewSizeForRenderManager() {
// TODO(brettw) this is a hack. See TabContentsView::SizeContents.
gfx::Size size = view_->GetContainerSize();
@@ -2866,6 +2876,14 @@ void TabContents::UpdateRenderViewSizeForRenderManager() {
view_->SizeContents(size);
}
+void TabContents::NotifySwappedFromRenderManager() {
+ NotifySwapped();
+}
+
+NavigationController& TabContents::GetControllerForRenderManager() {
+ return controller();
+}
+
DOMUI* TabContents::CreateDOMUIForRenderManager(const GURL& url) {
return DOMUIFactory::CreateDOMUIForURL(this, url);
}
@@ -3063,6 +3081,14 @@ void TabContents::SetSuppressMessageBoxes(bool suppress_message_boxes) {
set_suppress_javascript_messages(suppress_message_boxes);
}
+TabContents* TabContents::AsTabContents() {
+ return this;
+}
+
+ExtensionHost* TabContents::AsExtensionHost() {
+ return NULL;
+}
+
void TabContents::set_encoding(const std::string& encoding) {
encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding);
}
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 304a6d2..e01772f 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -680,8 +680,8 @@ class TabContents : public PageNavigator,
bool success,
const std::wstring& prompt);
virtual void SetSuppressMessageBoxes(bool suppress_message_boxes);
- virtual TabContents* AsTabContents() { return this; }
- virtual ExtensionHost* AsExtensionHost() { return NULL; }
+ virtual TabContents* AsTabContents();
+ virtual ExtensionHost* AsExtensionHost();
// The BookmarkDragDelegate is used to forward bookmark drag and drop events
// to extensions.
@@ -983,20 +983,12 @@ class TabContents : public PageNavigator,
bool proceed,
bool* proceed_to_fire_unload);
virtual void DidStartLoadingFromRenderManager(
- RenderViewHost* render_view_host) {
- DidStartLoading();
- }
+ RenderViewHost* render_view_host);
virtual void RenderViewGoneFromRenderManager(
- RenderViewHost* render_view_host) {
- RenderViewGone(render_view_host);
- }
+ RenderViewHost* render_view_host);
virtual void UpdateRenderViewSizeForRenderManager();
- virtual void NotifySwappedFromRenderManager() {
- NotifySwapped();
- }
- virtual NavigationController& GetControllerForRenderManager() {
- return controller();
- }
+ virtual void NotifySwappedFromRenderManager();
+ virtual NavigationController& GetControllerForRenderManager();
virtual DOMUI* CreateDOMUIForRenderManager(const GURL& url);
virtual NavigationEntry* GetLastCommittedNavigationEntryForRenderManager();
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.cc b/chrome/browser/tab_contents/tab_contents_delegate.cc
new file mode 100644
index 0000000..539c221
--- /dev/null
+++ b/chrome/browser/tab_contents/tab_contents_delegate.cc
@@ -0,0 +1,159 @@
+// 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/tab_contents/tab_contents_delegate.h"
+
+void TabContentsDelegate::DetachContents(TabContents* source) {
+}
+
+TabContents* TabContentsDelegate::GetConstrainingContents(TabContents* source) {
+ return source;
+}
+
+void TabContentsDelegate::ContentsMouseEvent(
+ TabContents* source, const gfx::Point& location, bool motion) {
+}
+
+void TabContentsDelegate::ContentsZoomChange(bool zoom_in) { }
+
+void TabContentsDelegate::OnContentSettingsChange(TabContents* source) { }
+
+bool TabContentsDelegate::IsApplication() const { return false; }
+
+void TabContentsDelegate::ConvertContentsToApplication(TabContents* source) { }
+
+bool TabContentsDelegate::CanBlur() const { return true; }
+
+bool TabContentsDelegate::CanReloadContents(TabContents* source) const {
+ return true;
+}
+
+gfx::Rect TabContentsDelegate::GetRootWindowResizerRect() const {
+ return gfx::Rect();
+}
+
+void TabContentsDelegate::ShowHtmlDialog(HtmlDialogUIDelegate* delegate,
+ gfx::NativeWindow parent_window) {
+}
+
+void TabContentsDelegate::BeforeUnloadFired(TabContents* tab,
+ bool proceed,
+ bool* proceed_to_fire_unload) {
+ *proceed_to_fire_unload = true;
+}
+
+void TabContentsDelegate::ForwardMessageToExternalHost(
+ const std::string& message,
+ const std::string& origin,
+ const std::string& target) {
+}
+
+bool TabContentsDelegate::IsExternalTabContainer() const { return false; }
+
+void TabContentsDelegate::SetFocusToLocationBar(bool select_all) {}
+
+void TabContentsDelegate::RenderWidgetShowing() {}
+
+ExtensionFunctionDispatcher*
+TabContentsDelegate::CreateExtensionFunctionDispatcher(
+ RenderViewHost* render_view_host,
+ const std::string& extension_id) {
+ return NULL;
+}
+
+bool TabContentsDelegate::TakeFocus(bool reverse) {
+ return false;
+}
+
+void TabContentsDelegate::SetTabContentBlocked(
+ TabContents* contents, bool blocked) {
+}
+
+void TabContentsDelegate::TabContentsFocused(TabContents* tab_content) {
+}
+
+int TabContentsDelegate::GetExtraRenderViewHeight() const {
+ return 0;
+}
+
+bool TabContentsDelegate::CanDownload(int request_id) {
+ return true;
+}
+
+void TabContentsDelegate::OnStartDownload(DownloadItem* download) {
+}
+
+bool TabContentsDelegate::HandleContextMenu(const ContextMenuParams& params) {
+ return false;
+}
+
+bool TabContentsDelegate::ExecuteContextMenuCommand(int command) {
+ return false;
+}
+
+void TabContentsDelegate::ConfirmAddSearchProvider(
+ const TemplateURL* template_url,
+ Profile* profile) {
+}
+
+void TabContentsDelegate::ShowPageInfo(Profile* profile,
+ const GURL& url,
+ const NavigationEntry::SSLStatus& ssl,
+ bool show_history) {
+}
+
+bool TabContentsDelegate::PreHandleKeyboardEvent(
+ const NativeWebKeyboardEvent& event,
+ bool* is_keyboard_shortcut) {
+ return false;
+}
+
+void TabContentsDelegate::HandleKeyboardEvent(
+ const NativeWebKeyboardEvent& event) {
+}
+
+void TabContentsDelegate::ShowRepostFormWarningDialog(
+ TabContents* tab_contents) {
+}
+
+void TabContentsDelegate::ShowContentSettingsWindow(
+ ContentSettingsType content_type) {
+}
+
+bool TabContentsDelegate::OnGoToEntryOffset(int offset) {
+ return true;
+}
+
+bool TabContentsDelegate::ShouldAddNavigationsToHistory() const {
+ return true;
+}
+
+void TabContentsDelegate::OnDidGetApplicationInfo(TabContents* tab_contents,
+ int32 page_id) {
+}
+
+Browser* TabContentsDelegate::GetBrowser() {
+ return NULL;
+}
+
+gfx::NativeWindow TabContentsDelegate::GetFrameNativeWindow() {
+ return NULL;
+}
+
+void TabContentsDelegate::TabContentsCreated(TabContents* new_contents) {
+}
+
+bool TabContentsDelegate::infobars_enabled() {
+ return true;
+}
+
+bool TabContentsDelegate::ShouldEnablePreferredSizeNotifications() {
+ return false;
+}
+
+void TabContentsDelegate::UpdatePreferredSize(const gfx::Size& pref_size) {
+}
+
+TabContentsDelegate::~TabContentsDelegate() {
+}
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h
index 9f80870..f7eb5e7 100644
--- a/chrome/browser/tab_contents/tab_contents_delegate.h
+++ b/chrome/browser/tab_contents/tab_contents_delegate.h
@@ -83,16 +83,14 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
// Causes the delegate to detach |source| and clean up any internal data
// pointing to it. After this call ownership of |source| passes to the
// caller, and it is safe to call "source->set_delegate(someone_else);".
- virtual void DetachContents(TabContents* source) { }
+ virtual void DetachContents(TabContents* source);
// Called to determine if the TabContents is contained in a popup window.
virtual bool IsPopup(TabContents* source) = 0;
// If |source| is constrained, returns the tab containing it. Otherwise
// returns |source|.
- virtual TabContents* GetConstrainingContents(TabContents* source) {
- return source;
- }
+ virtual TabContents* GetConstrainingContents(TabContents* source);
// Notification that some of our content has changed size as
// part of an animation.
@@ -108,43 +106,43 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
// coordinates of the mouse pointer and whether it was a normal motion event
// (otherwise, the pointer left the contents area).
virtual void ContentsMouseEvent(
- TabContents* source, const gfx::Point& location, bool motion) { }
+ TabContents* source, const gfx::Point& location, bool motion);
// Request the delegate to change the zoom level of the current tab.
- virtual void ContentsZoomChange(bool zoom_in) { }
+ virtual void ContentsZoomChange(bool zoom_in);
// Notifies the delegate that something has changed about what content the
// TabContents is blocking. Interested parties should call
// TabContents::IsContentBlocked() to see if something they care about has
// changed.
- virtual void OnContentSettingsChange(TabContents* source) { }
+ virtual void OnContentSettingsChange(TabContents* source);
// Check whether this contents is inside a window dedicated to running a web
// application.
- virtual bool IsApplication() const { return false; }
+ virtual bool IsApplication() const;
// Detach the given tab and convert it to a "webapp" view. The tab must be
// a TabContents with a valid WebApp set.
- virtual void ConvertContentsToApplication(TabContents* source) { }
+ virtual void ConvertContentsToApplication(TabContents* source);
// Whether this tab can be blurred through a javascript obj.blur()
// call. ConstrainedWindows shouldn't be able to be blurred.
- virtual bool CanBlur() const { return true; }
+ virtual bool CanBlur() const;
// Whether the specified tab can be reloaded.
// Reloading can be disabled e. g. for the DevTools window.
- virtual bool CanReloadContents(TabContents* source) const { return true; }
+ virtual bool CanReloadContents(TabContents* source) const;
// Return the rect where to display the resize corner, if any, otherwise
// an empty rect.
- virtual gfx::Rect GetRootWindowResizerRect() const { return gfx::Rect(); }
+ virtual gfx::Rect GetRootWindowResizerRect() const;
// Show a dialog with HTML content. |delegate| contains a pointer to the
// delegate who knows how to display the dialog (which file URL and JSON
// string input to use during initialization). |parent_window| is the window
// that should be parent of the dialog, or NULL for the default.
virtual void ShowHtmlDialog(HtmlDialogUIDelegate* delegate,
- gfx::NativeWindow parent_window) { }
+ gfx::NativeWindow parent_window);
// Tells us that we've finished firing this tab's beforeunload event.
// The proceed bool tells us whether the user chose to proceed closing the
@@ -153,82 +151,65 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
// unload events until all the beforeunload events have fired.
virtual void BeforeUnloadFired(TabContents* tab,
bool proceed,
- bool* proceed_to_fire_unload) {
- *proceed_to_fire_unload = true;
- }
+ bool* proceed_to_fire_unload);
// Send IPC to external host. Default implementation is do nothing.
virtual void ForwardMessageToExternalHost(const std::string& message,
const std::string& origin,
- const std::string& target) {
- }
+ const std::string& target);
// If the delegate is hosting tabs externally.
- virtual bool IsExternalTabContainer() const { return false; }
+ virtual bool IsExternalTabContainer() const;
// Sets focus to the location bar or some other place that is appropriate.
// This is called when the tab wants to encourage user input, like for the
// new tab page.
- virtual void SetFocusToLocationBar(bool select_all) {}
+ virtual void SetFocusToLocationBar(bool select_all);
// Called when a popup select is about to be displayed. The delegate can use
// this to disable inactive rendering for the frame in the window the select
// is opened within if necessary.
- virtual void RenderWidgetShowing() {}
+ virtual void RenderWidgetShowing();
// This is used when the contents is an extension that needs to route
// api calls through to the Browser process.
virtual ExtensionFunctionDispatcher* CreateExtensionFunctionDispatcher(
RenderViewHost* render_view_host,
- const std::string& extension_id) {
- return NULL;
- }
+ const std::string& extension_id);
// This is called when webkit tells us that it is done tabbing through
// controls on the page. Provides a way for TabContentsDelegates to handle
// this. Returns true if the delegate successfully handled it.
- virtual bool TakeFocus(bool reverse) {
- return false;
- }
+ virtual bool TakeFocus(bool reverse);
// Changes the blocked state of the tab at |index|. TabContents are
// considered blocked while displaying a tab modal dialog. During that time
// renderer host will ignore any UI interaction within TabContent outside of
// the currently displaying dialog.
- virtual void SetTabContentBlocked(TabContents* contents, bool blocked) { }
+ virtual void SetTabContentBlocked(TabContents* contents, bool blocked);
// Notification that |tab_contents| has gained focus.
- virtual void TabContentsFocused(TabContents* tab_content) { }
+ virtual void TabContentsFocused(TabContents* tab_content);
// Return much extra vertical space should be allotted to the
// render view widget during various animations (e.g. infobar closing).
// This is used to make painting look smoother.
- virtual int GetExtraRenderViewHeight() const {
- return 0;
- }
+ virtual int GetExtraRenderViewHeight() const;
- virtual bool CanDownload(int request_id) {
- return true;
- }
+ virtual bool CanDownload(int request_id);
- virtual void OnStartDownload(DownloadItem* download) {
- }
+ virtual void OnStartDownload(DownloadItem* download);
// Returns true if the context menu operation was handled by the delegate.
- virtual bool HandleContextMenu(const ContextMenuParams& params) {
- return false;
- }
+ virtual bool HandleContextMenu(const ContextMenuParams& params);
// Returns true if the context menu command was handled
- virtual bool ExecuteContextMenuCommand(int command) {
- return false;
- }
+ virtual bool ExecuteContextMenuCommand(int command);
// Shows a confirmation UI that the specified |template_url| is to be added as
// a search engine.
virtual void ConfirmAddSearchProvider(const TemplateURL* template_url,
- Profile* profile) {
- }
+ Profile* profile);
// Shows the page info using the specified information.
// |url| is the url of the page/frame the info applies to, |ssl| is the SSL
@@ -237,67 +218,61 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
virtual void ShowPageInfo(Profile* profile,
const GURL& url,
const NavigationEntry::SSLStatus& ssl,
- bool show_history) {
- }
+ bool show_history);
// Allows delegates to handle keyboard events before sending to the renderer.
// Returns true if the |event| was handled. Otherwise, if the |event| would be
// handled in HandleKeyboardEvent() method as a normal keyboard shortcut,
// |*is_keyboard_shortcut| should be set to true.
virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
- bool* is_keyboard_shortcut) {
- return false;
- }
+ bool* is_keyboard_shortcut);
// Allows delegates to handle unhandled keyboard messages coming back from
// the renderer.
- virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {}
+ virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event);
// Shows the repost form confirmation dialog box.
- virtual void ShowRepostFormWarningDialog(TabContents* tab_contents) {}
+ virtual void ShowRepostFormWarningDialog(TabContents* tab_contents);
// Shows the Content Settings dialog for a given content type.
- virtual void ShowContentSettingsWindow(ContentSettingsType content_type) {}
+ virtual void ShowContentSettingsWindow(ContentSettingsType content_type);
// Allows delegate to override navigation to the history entries.
// Returns true to allow TabContents to continue with the default processing.
- virtual bool OnGoToEntryOffset(int offset) {
- return true;
- }
+ virtual bool OnGoToEntryOffset(int offset);
// Returns whether this tab contents should add navigations to history.
- virtual bool ShouldAddNavigationsToHistory() const { return true; }
+ virtual bool ShouldAddNavigationsToHistory() const;
// Notification when web app info data is available
virtual void OnDidGetApplicationInfo(TabContents* tab_contents,
- int32 page_id) {
- }
+ int32 page_id);
// Returns the browser in which the tab contents is being displayed.
- virtual Browser* GetBrowser() { return NULL; }
+ virtual Browser* GetBrowser();
// Returns the native window framing the view containing the tab contents.
- virtual gfx::NativeWindow GetFrameNativeWindow() { return NULL; }
+ virtual gfx::NativeWindow GetFrameNativeWindow();
// Notifies the delegate about the creation of a new TabContents. This
// typically happens when popups are created.
- virtual void TabContentsCreated(TabContents* new_contents) {}
+ virtual void TabContentsCreated(TabContents* new_contents);
// Returns whether infobars are enabled. Overrideable by child classes.
- virtual bool infobars_enabled() { return true; }
+ virtual bool infobars_enabled();
// Whether the renderer should report its preferred size when it changes by
// calling UpdatePreferredSize().
// Note that this is set when the RenderViewHost is created and cannot be
// changed after that.
- virtual bool ShouldEnablePreferredSizeNotifications() { return false; }
+ virtual bool ShouldEnablePreferredSizeNotifications();
// Notification that the preferred size of the contents has changed.
// Only called if ShouldEnablePreferredSizeNotifications() returns true.
- virtual void UpdatePreferredSize(const gfx::Size& pref_size) {}
+ virtual void UpdatePreferredSize(const gfx::Size& pref_size);
protected:
- ~TabContentsDelegate() {}
+ ~TabContentsDelegate();
};
#endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index ef4677b..711e00e 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -46,6 +46,66 @@ bool ShouldForgetOpenersForTransition(PageTransition::Type transition) {
} // namespace
///////////////////////////////////////////////////////////////////////////////
+// TabStripModelObserver, public:
+
+void TabStripModelObserver::TabInsertedAt(TabContents* contents,
+ int index,
+ bool foreground) {
+}
+
+void TabStripModelObserver::TabClosingAt(TabContents* contents, int index) {
+}
+
+void TabStripModelObserver::TabDetachedAt(TabContents* contents, int index) {
+}
+
+void TabStripModelObserver::TabDeselectedAt(TabContents* contents, int index) {
+}
+
+void TabStripModelObserver::TabSelectedAt(TabContents* old_contents,
+ TabContents* new_contents,
+ int index,
+ bool user_gesture) {
+}
+
+void TabStripModelObserver::TabMoved(TabContents* contents,
+ int from_index,
+ int to_index) {
+}
+
+void TabStripModelObserver::TabChangedAt(TabContents* contents, int index,
+ TabChangeType change_type) {
+}
+
+void TabStripModelObserver::TabReplacedAt(TabContents* old_contents,
+ TabContents* new_contents,
+ int index) {
+}
+
+void TabStripModelObserver::TabPinnedStateChanged(TabContents* contents,
+ int index) {
+}
+
+void TabStripModelObserver::TabMiniStateChanged(TabContents* contents,
+ int index) {
+}
+
+void TabStripModelObserver::TabBlockedStateChanged(TabContents* contents,
+ int index) {
+}
+
+void TabStripModelObserver::TabStripEmpty() {}
+
+void TabStripModelObserver::TabStripModelDeleted() {}
+
+///////////////////////////////////////////////////////////////////////////////
+// TabStripModelDelegate, public:
+
+bool TabStripModelDelegate::CanCloseTab() const {
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////////////////
// TabStripModel, public:
TabStripModel::TabStripModel(TabStripModelDelegate* delegate, Profile* profile)
diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h
index 4c1ad28..c00dbff 100644
--- a/chrome/browser/tabs/tab_strip_model.h
+++ b/chrome/browser/tabs/tab_strip_model.h
@@ -59,21 +59,21 @@ class TabStripModelObserver {
// (selected).
virtual void TabInsertedAt(TabContents* contents,
int index,
- bool foreground) {}
+ bool foreground);
// The specified TabContents at |index| is being closed (and eventually
// destroyed).
- virtual void TabClosingAt(TabContents* contents, int index) {}
+ virtual void TabClosingAt(TabContents* contents, int index);
// The specified TabContents at |index| is being detached, perhaps to be
// inserted in another TabStripModel. The implementer should take whatever
// action is necessary to deal with the TabContents no longer being present.
- virtual void TabDetachedAt(TabContents* contents, int index) {}
+ virtual void TabDetachedAt(TabContents* contents, int index);
// The selected TabContents is about to change from |old_contents| at |index|.
// This gives observers a chance to prepare for an impending switch before it
// happens.
- virtual void TabDeselectedAt(TabContents* contents, int index) {}
+ virtual void TabDeselectedAt(TabContents* contents, int index);
// The selected TabContents changed from |old_contents| to |new_contents| at
// |index|. |user_gesture| specifies whether or not this was done by a user
@@ -82,12 +82,12 @@ class TabStripModelObserver {
virtual void TabSelectedAt(TabContents* old_contents,
TabContents* new_contents,
int index,
- bool user_gesture) {}
+ bool user_gesture);
// The specified TabContents at |from_index| was moved to |to_index|.
virtual void TabMoved(TabContents* contents,
int from_index,
- int to_index) {}
+ int to_index);
// The specified TabContents at |index| changed in some way. |contents| may
// be an entirely different object and the old value is no longer available
@@ -95,40 +95,40 @@ class TabStripModelObserver {
//
// See TabChangeType for a description of |change_type|.
virtual void TabChangedAt(TabContents* contents, int index,
- TabChangeType change_type) {}
+ TabChangeType change_type);
// The tab contents was replaced at the specified index. This is invoked when
// a tab becomes phantom. See description of phantom tabs in class description
// of TabStripModel for details.
virtual void TabReplacedAt(TabContents* old_contents,
- TabContents* new_contents, int index) {}
+ TabContents* new_contents, int index);
// Invoked when the pinned state of a tab changes. This is not invoked if the
// tab ends up moving as a result of the mini state changing.
// See note in TabMiniStateChanged as to how this relates to
// TabMiniStateChanged.
- virtual void TabPinnedStateChanged(TabContents* contents, int index) {}
+ virtual void TabPinnedStateChanged(TabContents* contents, int index);
// Invoked if the mini state of a tab changes. This is not invoked if the
// tab ends up moving as a result of the mini state changing.
// NOTE: this is sent when the pinned state of a non-app tab changes and is
// sent in addition to TabPinnedStateChanged. UI code typically need not care
// about TabPinnedStateChanged, but instead this.
- virtual void TabMiniStateChanged(TabContents* contents, int index) {}
+ virtual void TabMiniStateChanged(TabContents* contents, int index);
// Invoked when the blocked state of a tab changes.
// NOTE: This is invoked when a tab becomes blocked/unblocked by a tab modal
// window.
- virtual void TabBlockedStateChanged(TabContents* contents, int index) {}
+ virtual void TabBlockedStateChanged(TabContents* contents, int index);
// The TabStripModel now no longer has any phantom tabs. The implementer may
// use this as a trigger to try and close the window containing the
// TabStripModel, for example...
- virtual void TabStripEmpty() {}
+ virtual void TabStripEmpty();
// Sent when the tabstrip model is about to be deleted and any reference held
// must be dropped.
- virtual void TabStripModelDeleted() {}
+ virtual void TabStripModelDeleted();
};
///////////////////////////////////////////////////////////////////////////////
@@ -229,9 +229,7 @@ class TabStripModelDelegate {
virtual void BookmarkAllTabs() = 0;
// Returns true if any of the tabs can be closed.
- virtual bool CanCloseTab() const {
- return true;
- }
+ virtual bool CanCloseTab() const;
// Returns true if the vertical tabstrip presentation should be used.
virtual bool UseVerticalTabs() const = 0;
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index c53d6be..e5438f3 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -206,6 +206,8 @@
'browser/automation/automation_provider_observers.h',
'browser/automation/automation_resource_message_filter.cc',
'browser/automation/automation_resource_message_filter.h',
+ 'browser/automation/automation_resource_routing_delegate.cc',
+ 'browser/automation/automation_resource_routing_delegate.h',
'browser/automation/automation_resource_tracker.cc',
'browser/automation/automation_resource_tracker.h',
'browser/automation/automation_tab_tracker.h',
@@ -2359,6 +2361,7 @@
'browser/tab_contents/security_style.h',
'browser/tab_contents/tab_contents.cc',
'browser/tab_contents/tab_contents.h',
+ 'browser/tab_contents/tab_contents_delegate.cc',
'browser/tab_contents/tab_contents_delegate.h',
'browser/tab_contents/tab_contents_view.cc',
'browser/tab_contents/tab_contents_view.h',