diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-08 17:50:46 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-08 17:50:46 +0000 |
commit | 02d08e07d137b394792d15b712d029455713b195 (patch) | |
tree | f1a662492bc8a3aa9b336b459cc6d07531ec0b02 | |
parent | 2aad74f0f82e51769b6a11516d1136722aead390 (diff) | |
download | chromium_src-02d08e07d137b394792d15b712d029455713b195.zip chromium_src-02d08e07d137b394792d15b712d029455713b195.tar.gz chromium_src-02d08e07d137b394792d15b712d029455713b195.tar.bz2 |
FBTF: Small nits; moving virtual methods to implementation.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/3627002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61976 0039d316-1c4b-4281-b951-d872f2087c98
29 files changed, 234 insertions, 114 deletions
diff --git a/chrome/browser/accessibility_events.cc b/chrome/browser/accessibility_events.cc index aade4b3..af2a2e0 100644 --- a/chrome/browser/accessibility_events.cc +++ b/chrome/browser/accessibility_events.cc @@ -29,18 +29,43 @@ void AccessibilityControlInfo::SerializeToDict(DictionaryValue *dict) const { dict->SetString(keys::kTypeKey, type()); } +AccessibilityWindowInfo::AccessibilityWindowInfo(Profile* profile, + std::string window_name) + : AccessibilityControlInfo(profile, window_name) { +} + const char* AccessibilityWindowInfo::type() const { return keys::kTypeWindow; } +AccessibilityButtonInfo::AccessibilityButtonInfo(Profile* profile, + std::string button_name) + : AccessibilityControlInfo(profile, button_name) { +} + const char* AccessibilityButtonInfo::type() const { return keys::kTypeButton; } +AccessibilityLinkInfo::AccessibilityLinkInfo(Profile* profile, + std::string link_name) + : AccessibilityControlInfo(profile, link_name) { } + const char* AccessibilityLinkInfo::type() const { return keys::kTypeLink; } +AccessibilityRadioButtonInfo::AccessibilityRadioButtonInfo(Profile* profile, + std::string name, + bool checked, + int item_index, + int item_count) + : AccessibilityControlInfo(profile, name), + checked_(checked), + item_index_(item_index), + item_count_(item_count) { +} + const char* AccessibilityRadioButtonInfo::type() const { return keys::kTypeRadioButton; } @@ -53,6 +78,13 @@ void AccessibilityRadioButtonInfo::SerializeToDict( dict->SetInteger(keys::kItemCountKey, item_count_); } +AccessibilityCheckboxInfo::AccessibilityCheckboxInfo(Profile* profile, + std::string name, + bool checked) + : AccessibilityControlInfo(profile, name), + checked_(checked) { +} + const char* AccessibilityCheckboxInfo::type() const { return keys::kTypeCheckbox; } @@ -62,6 +94,15 @@ void AccessibilityCheckboxInfo::SerializeToDict(DictionaryValue *dict) const { dict->SetBoolean(keys::kCheckedKey, checked_); } +AccessibilityTabInfo::AccessibilityTabInfo(Profile* profile, + std::string tab_name, + int tab_index, + int tab_count) + : AccessibilityControlInfo(profile, tab_name), + tab_index_(tab_index), + tab_count_(tab_count) { +} + const char* AccessibilityTabInfo::type() const { return keys::kTypeTab; } @@ -72,6 +113,17 @@ void AccessibilityTabInfo::SerializeToDict(DictionaryValue *dict) const { dict->SetInteger(keys::kItemCountKey, tab_count_); } +AccessibilityComboBoxInfo::AccessibilityComboBoxInfo(Profile* profile, + std::string name, + std::string value, + int item_index, + int item_count) + : AccessibilityControlInfo(profile, name), + value_(value), + item_index_(item_index), + item_count_(item_count) { +} + const char* AccessibilityComboBoxInfo::type() const { return keys::kTypeComboBox; } @@ -83,6 +135,16 @@ void AccessibilityComboBoxInfo::SerializeToDict(DictionaryValue *dict) const { dict->SetInteger(keys::kItemCountKey, item_count_); } +AccessibilityTextBoxInfo::AccessibilityTextBoxInfo(Profile* profile, + std::string name, + bool password) + : AccessibilityControlInfo(profile, name), + value_(""), + password_(password), + selection_start_(0), + selection_end_(0) { +} + const char* AccessibilityTextBoxInfo::type() const { return keys::kTypeTextBox; } @@ -95,6 +157,17 @@ void AccessibilityTextBoxInfo::SerializeToDict(DictionaryValue *dict) const { dict->SetInteger(keys::kSelectionEndKey, selection_end_); } +AccessibilityListBoxInfo::AccessibilityListBoxInfo(Profile* profile, + std::string name, + std::string value, + int item_index, + int item_count) + : AccessibilityControlInfo(profile, name), + value_(value), + item_index_(item_index), + item_count_(item_count) { +} + const char* AccessibilityListBoxInfo::type() const { return keys::kTypeListBox; } @@ -106,10 +179,26 @@ void AccessibilityListBoxInfo::SerializeToDict(DictionaryValue *dict) const { dict->SetInteger(keys::kItemCountKey, item_count_); } +AccessibilityMenuInfo::AccessibilityMenuInfo(Profile* profile, + std::string menu_name) + : AccessibilityControlInfo(profile, menu_name) { +} + const char* AccessibilityMenuInfo::type() const { return keys::kTypeMenu; } +AccessibilityMenuItemInfo::AccessibilityMenuItemInfo(Profile* profile, + std::string name, + bool has_submenu, + int item_index, + int item_count) + : AccessibilityControlInfo(profile, name), + has_submenu_(has_submenu), + item_index_(item_index), + item_count_(item_count) { +} + const char* AccessibilityMenuItemInfo::type() const { return keys::kTypeMenuItem; } diff --git a/chrome/browser/accessibility_events.h b/chrome/browser/accessibility_events.h index 4e765c2..2995e77 100644 --- a/chrome/browser/accessibility_events.h +++ b/chrome/browser/accessibility_events.h @@ -54,8 +54,7 @@ class AccessibilityControlInfo { // and onWindowClosed event listeners. class AccessibilityWindowInfo : public AccessibilityControlInfo { public: - AccessibilityWindowInfo(Profile* profile, std::string window_name) - : AccessibilityControlInfo(profile, window_name) { } + AccessibilityWindowInfo(Profile* profile, std::string window_name); virtual const char* type() const; }; @@ -64,8 +63,7 @@ class AccessibilityWindowInfo : public AccessibilityControlInfo { // and onControlAction event listeners. class AccessibilityButtonInfo : public AccessibilityControlInfo { public: - AccessibilityButtonInfo(Profile* profile, std::string button_name) - : AccessibilityControlInfo(profile, button_name) { } + AccessibilityButtonInfo(Profile* profile, std::string button_name); virtual const char* type() const; }; @@ -74,8 +72,7 @@ class AccessibilityButtonInfo : public AccessibilityControlInfo { // and onControlAction event listeners. class AccessibilityLinkInfo : public AccessibilityControlInfo { public: - AccessibilityLinkInfo(Profile* profile, std::string link_name) - : AccessibilityControlInfo(profile, link_name) { } + AccessibilityLinkInfo(Profile* profile, std::string link_name); virtual const char* type() const; }; @@ -88,12 +85,7 @@ class AccessibilityRadioButtonInfo : public AccessibilityControlInfo { std::string name, bool checked, int item_index, - int item_count) - : AccessibilityControlInfo(profile, name), - checked_(checked), - item_index_(item_index), - item_count_(item_count) { - } + int item_count); virtual const char* type() const; @@ -118,10 +110,7 @@ class AccessibilityCheckboxInfo : public AccessibilityControlInfo { public: AccessibilityCheckboxInfo(Profile* profile, std::string name, - bool checked) - : AccessibilityControlInfo(profile, name), - checked_(checked) { - } + bool checked); virtual const char* type() const; @@ -142,11 +131,7 @@ class AccessibilityTabInfo : public AccessibilityControlInfo { AccessibilityTabInfo(Profile* profile, std::string tab_name, int tab_index, - int tab_count) - : AccessibilityControlInfo(profile, tab_name), - tab_index_(tab_index), - tab_count_(tab_count) { - } + int tab_count); virtual const char* type() const; @@ -174,12 +159,7 @@ class AccessibilityComboBoxInfo : public AccessibilityControlInfo { std::string name, std::string value, int item_index, - int item_count) - : AccessibilityControlInfo(profile, name), - value_(value), - item_index_(item_index), - item_count_(item_count) { - } + int item_count); virtual const char* type() const; @@ -209,13 +189,7 @@ class AccessibilityTextBoxInfo : public AccessibilityControlInfo { public: AccessibilityTextBoxInfo(Profile* profile, std::string name, - bool password) - : AccessibilityControlInfo(profile, name), - value_(""), - password_(password), - selection_start_(0), - selection_end_(0) { - } + bool password); virtual const char* type() const; @@ -247,12 +221,7 @@ class AccessibilityListBoxInfo : public AccessibilityControlInfo { std::string name, std::string value, int item_index, - int item_count) - : AccessibilityControlInfo(profile, name), - value_(value), - item_index_(item_index), - item_count_(item_count) { - } + int item_count); virtual const char* type() const; @@ -280,8 +249,7 @@ class AccessibilityListBoxInfo : public AccessibilityControlInfo { // onMenuOpened, onMenuClosed, and onControlFocused event listeners. class AccessibilityMenuInfo : public AccessibilityControlInfo { public: - AccessibilityMenuInfo(Profile* profile, std::string menu_name) - : AccessibilityControlInfo(profile, menu_name) { } + AccessibilityMenuInfo(Profile* profile, std::string menu_name); virtual const char* type() const; }; @@ -294,12 +262,7 @@ class AccessibilityMenuItemInfo : public AccessibilityControlInfo { std::string name, bool has_submenu, int item_index, - int item_count) - : AccessibilityControlInfo(profile, name), - has_submenu_(has_submenu), - item_index_(item_index), - item_count_(item_count) { - } + int item_count); virtual const char* type() const; diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc index eb94b8f..cf516e5 100644 --- a/chrome/browser/autocomplete/autocomplete.cc +++ b/chrome/browser/autocomplete/autocomplete.cc @@ -752,6 +752,11 @@ void AutocompleteResult::SortAndCull(const AutocompleteInput& input) { alternate_nav_url_ = input.canonicalized_url(); } +void AutocompleteResult::Reset() { + matches_.clear(); + default_match_ = end(); +} + #ifndef NDEBUG void AutocompleteResult::Validate() const { for (const_iterator i(begin()); i != end(); ++i) diff --git a/chrome/browser/autocomplete/autocomplete.h b/chrome/browser/autocomplete/autocomplete.h index 1509931..23bd053 100644 --- a/chrome/browser/autocomplete/autocomplete.h +++ b/chrome/browser/autocomplete/autocomplete.h @@ -662,10 +662,7 @@ class AutocompleteResult { GURL alternate_nav_url() const { return alternate_nav_url_; } // Clears the matches for this result set. - void Reset() { - matches_.clear(); - default_match_ = end(); - } + void Reset(); #ifndef NDEBUG // Does a data integrity check on this result. diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc index 4150e69..4ef273f 100644 --- a/chrome/browser/autofill/autofill_profile.cc +++ b/chrome/browser/autofill/autofill_profile.cc @@ -161,6 +161,10 @@ FormGroup* AutoFillProfile::Clone() const { return profile; } +const string16& AutoFillProfile::Label() const { + return label_; +} + string16 AutoFillProfile::PreviewSummary() const { // Fetch the components of the summary string. Any or all of these // may be an empty string. diff --git a/chrome/browser/autofill/autofill_profile.h b/chrome/browser/autofill/autofill_profile.h index 676bc77..1da4f27 100644 --- a/chrome/browser/autofill/autofill_profile.h +++ b/chrome/browser/autofill/autofill_profile.h @@ -42,7 +42,7 @@ class AutoFillProfile : public FormGroup { // Returns a copy of the profile it is called on. The caller is responsible // for deleting profile when they are done with it. virtual FormGroup* Clone() const; - virtual const string16& Label() const { return label_; } + virtual const string16& Label() const; void set_unique_id(int id) { unique_id_ = id; } int unique_id() const { return unique_id_; } diff --git a/chrome/browser/autofill/credit_card_field.cc b/chrome/browser/autofill/credit_card_field.cc index 7bf8db6..832fe71 100644 --- a/chrome/browser/autofill/credit_card_field.cc +++ b/chrome/browser/autofill/credit_card_field.cc @@ -35,6 +35,10 @@ bool CreditCardField::GetFieldInfo(FieldTypeMap* field_type_map) const { return ok; } +FormFieldType CreditCardField::GetFormFieldType() const { + return kCreditCardType; +} + // static CreditCardField* CreditCardField::Parse( std::vector<AutoFillField*>::const_iterator* iter, diff --git a/chrome/browser/autofill/credit_card_field.h b/chrome/browser/autofill/credit_card_field.h index 68cc0db..e3b443d 100644 --- a/chrome/browser/autofill/credit_card_field.h +++ b/chrome/browser/autofill/credit_card_field.h @@ -16,7 +16,7 @@ class CreditCardField : public FormField { public: // FormField implementation: virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const; - virtual FormFieldType GetFormFieldType() const { return kCreditCardType; } + virtual FormFieldType GetFormFieldType() const; static CreditCardField* Parse( std::vector<AutoFillField*>::const_iterator* iter, diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index 606c205..1f94e6a 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -54,6 +54,11 @@ void BookmarkNode::Initialize(int64 id) { date_added_ = Time::Now(); } +void BookmarkNode::InvalidateFavicon() { + loaded_favicon_ = false; + favicon_ = SkBitmap(); +} + void BookmarkNode::Reset(const history::StarredEntry& entry) { DCHECK(entry.type != history::StarredEntry::URL || entry.url == url_); @@ -311,6 +316,10 @@ void BookmarkModel::SetURL(const BookmarkNode* node, const GURL& url) { BookmarkNodeChanged(this, node)); } +bool BookmarkModel::IsLoaded() { + return loaded_; +} + void BookmarkModel::GetNodesByURL(const GURL& url, std::vector<const BookmarkNode*>* nodes) { AutoLock url_lock(url_lock_); diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index 015de94..09a3cff 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -115,10 +115,7 @@ class BookmarkNode : public TreeNode<BookmarkNode> { } // Called when the favicon becomes invalid. - void InvalidateFavicon() { - loaded_favicon_ = false; - favicon_ = SkBitmap(); - } + void InvalidateFavicon(); // Resets the properties of the node from the supplied entry. // This is used by the bookmark model and not really useful outside of it. @@ -237,7 +234,7 @@ class BookmarkModel : public NotificationObserver, public BookmarkService { void SetURL(const BookmarkNode* node, const GURL& url); // Returns true if the model finished loading. - virtual bool IsLoaded() { return loaded_; } + virtual bool IsLoaded(); // Returns the set of nodes with the specified URL. void GetNodesByURL(const GURL& url, std::vector<const BookmarkNode*>* nodes); diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index 9f8b171..115eb41 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -361,6 +361,14 @@ void UrlsToTabs(const std::vector<GURL>& urls, } // namespace +BrowserInit::BrowserInit() {} + +BrowserInit::~BrowserInit() {} + +void BrowserInit::AddFirstRunTab(const GURL& url) { + first_run_tabs_.push_back(url); +} + // static bool BrowserInit::InProcessStartup() { return in_startup; @@ -441,6 +449,12 @@ bool BrowserInit::LaunchBrowser(const CommandLine& command_line, return true; } +// Tab ------------------------------------------------------------------------ + +BrowserInit::LaunchWithProfile::Tab::Tab() : is_app(false), is_pinned(true) {} + +BrowserInit::LaunchWithProfile::Tab::~Tab() {} + // LaunchWithProfile ---------------------------------------------------------- BrowserInit::LaunchWithProfile::LaunchWithProfile( diff --git a/chrome/browser/browser_init.h b/chrome/browser/browser_init.h index 4676cfe..d5cb393 100644 --- a/chrome/browser/browser_init.h +++ b/chrome/browser/browser_init.h @@ -24,14 +24,12 @@ class TabContents; // initialize the profile. class BrowserInit { public: - BrowserInit() {} - ~BrowserInit() {} + BrowserInit(); + ~BrowserInit(); // Adds a url to be opened during first run. This overrides the standard // tabs shown at first run. - void AddFirstRunTab(const GURL& url) { - first_run_tabs_.push_back(url); - } + void AddFirstRunTab(const GURL& url); // This function is equivalent to ProcessCommandLine but should only be // called during actual process startup. @@ -79,7 +77,8 @@ class BrowserInit { public: // Used by OpenTabsInBrowser. struct Tab { - Tab() : is_app(false), is_pinned(true) {} + Tab(); + ~Tab(); // The url to load. GURL url; diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc index 0789957..6bacfd0 100644 --- a/chrome/browser/chrome_plugin_host.cc +++ b/chrome/browser/chrome_plugin_host.cc @@ -813,6 +813,12 @@ CPBrowserFuncs* GetCPBrowserFuncsForBrowser() { return &browser_funcs; } +void CPCommandInterface::OnCommandInvoked(CPError retval) { + delete this; +} + +void CPCommandInterface::OnCommandResponse(CPError retval) {} + void CPHandleCommand(int command, CPCommandInterface* data, CPBrowsingContext context) { // Sadly if we try and pass context through, we seem to break cl's little diff --git a/chrome/browser/chrome_plugin_host.h b/chrome/browser/chrome_plugin_host.h index 13a7736..af8ee15 100644 --- a/chrome/browser/chrome_plugin_host.h +++ b/chrome/browser/chrome_plugin_host.h @@ -23,13 +23,11 @@ class CPCommandInterface { // Called when the command has been invoked. The default action is deletion, // but some callers may want to use output or check the return value before // deleting. - virtual void OnCommandInvoked(CPError retval) { - delete this; - } + virtual void OnCommandInvoked(CPError retval); // Some commands have an asynchronous response. This is called some time // after OnCommandInvoked. - virtual void OnCommandResponse(CPError retval) { } + virtual void OnCommandResponse(CPError retval); }; // Called when a builtin or plugin-registered UI command is invoked by a user diff --git a/chrome/browser/content_exceptions_table_model.cc b/chrome/browser/content_exceptions_table_model.cc index bf32612..b464955 100644 --- a/chrome/browser/content_exceptions_table_model.cc +++ b/chrome/browser/content_exceptions_table_model.cc @@ -27,6 +27,8 @@ ContentExceptionsTableModel::ContentExceptionsTableModel( } } +ContentExceptionsTableModel::~ContentExceptionsTableModel() {} + void ContentExceptionsTableModel::AddException( const HostContentSettingsMap::Pattern& pattern, ContentSetting setting, diff --git a/chrome/browser/content_exceptions_table_model.h b/chrome/browser/content_exceptions_table_model.h index 8e29591..245522e 100644 --- a/chrome/browser/content_exceptions_table_model.h +++ b/chrome/browser/content_exceptions_table_model.h @@ -19,6 +19,7 @@ class ContentExceptionsTableModel : public TableModel { ContentExceptionsTableModel(HostContentSettingsMap* map, HostContentSettingsMap* off_the_record_map, ContentSettingsType content_type); + virtual ~ContentExceptionsTableModel(); HostContentSettingsMap* map() const { return map_; } HostContentSettingsMap* off_the_record_map() const { diff --git a/chrome/browser/cookies_tree_model.cc b/chrome/browser/cookies_tree_model.cc index 2fbd557..1dd02be 100644 --- a/chrome/browser/cookies_tree_model.cc +++ b/chrome/browser/cookies_tree_model.cc @@ -242,6 +242,13 @@ CookieTreeOriginNode::CookieTreeOriginNode(const GURL& url) indexed_dbs_child_(NULL), url_(url) {} +CookieTreeOriginNode::~CookieTreeOriginNode() {} + +CookieTreeNode::DetailedInfo CookieTreeOriginNode::GetDetailedInfo() const { + return DetailedInfo(GetTitle(), + DetailedInfo::TYPE_ORIGIN, + NULL, NULL, NULL, NULL, NULL, NULL); +} CookieTreeCookiesNode* CookieTreeOriginNode::GetOrCreateCookiesNode() { if (cookies_child_) diff --git a/chrome/browser/cookies_tree_model.h b/chrome/browser/cookies_tree_model.h index 509084a..40b29b8 100644 --- a/chrome/browser/cookies_tree_model.h +++ b/chrome/browser/cookies_tree_model.h @@ -188,14 +188,10 @@ class CookieTreeOriginNode : public CookieTreeNode { static std::wstring TitleForUrl(const GURL& url); explicit CookieTreeOriginNode(const GURL& url); - virtual ~CookieTreeOriginNode() {} + virtual ~CookieTreeOriginNode(); // CookieTreeNode methods: - virtual DetailedInfo GetDetailedInfo() const { - return DetailedInfo(GetTitle(), - DetailedInfo::TYPE_ORIGIN, - NULL, NULL, NULL, NULL, NULL, NULL); - } + virtual DetailedInfo GetDetailedInfo() const; // CookieTreeOriginNode methods: CookieTreeCookiesNode* GetOrCreateCookiesNode(); diff --git a/chrome/browser/ssl/ssl_add_cert_handler.cc b/chrome/browser/ssl/ssl_add_cert_handler.cc index 8cb4a8e..1a78510 100644 --- a/chrome/browser/ssl/ssl_add_cert_handler.cc +++ b/chrome/browser/ssl/ssl_add_cert_handler.cc @@ -32,6 +32,8 @@ SSLAddCertHandler::SSLAddCertHandler(URLRequest* request, NewRunnableMethod(this, &SSLAddCertHandler::Run)); } +SSLAddCertHandler::~SSLAddCertHandler() {} + void SSLAddCertHandler::Run() { int cert_error; { diff --git a/chrome/browser/ssl/ssl_add_cert_handler.h b/chrome/browser/ssl/ssl_add_cert_handler.h index 0c4ec22..fd73be5 100644 --- a/chrome/browser/ssl/ssl_add_cert_handler.h +++ b/chrome/browser/ssl/ssl_add_cert_handler.h @@ -33,6 +33,7 @@ class SSLAddCertHandler : public base::RefCountedThreadSafe<SSLAddCertHandler> { private: friend class base::RefCountedThreadSafe<SSLAddCertHandler>; + virtual ~SSLAddCertHandler(); // Runs the handler. Called on the IO thread. void Run(); diff --git a/chrome/browser/ssl/ssl_cert_error_handler.cc b/chrome/browser/ssl/ssl_cert_error_handler.cc index d7dddf1..b3d7f87 100644 --- a/chrome/browser/ssl/ssl_cert_error_handler.cc +++ b/chrome/browser/ssl/ssl_cert_error_handler.cc @@ -7,6 +7,7 @@ #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/browser/ssl/ssl_manager.h" #include "chrome/browser/ssl/ssl_policy.h" +#include "net/base/x509_certificate.h" SSLCertErrorHandler::SSLCertErrorHandler( ResourceDispatcherHost* rdh, @@ -34,3 +35,5 @@ void SSLCertErrorHandler::OnDispatchFailed() { void SSLCertErrorHandler::OnDispatched() { manager_->policy()->OnCertError(this); } + +SSLCertErrorHandler::~SSLCertErrorHandler() {} diff --git a/chrome/browser/ssl/ssl_cert_error_handler.h b/chrome/browser/ssl/ssl_cert_error_handler.h index 0584e6a..7a0ca31 100644 --- a/chrome/browser/ssl/ssl_cert_error_handler.h +++ b/chrome/browser/ssl/ssl_cert_error_handler.h @@ -10,7 +10,10 @@ #include "chrome/browser/ssl/ssl_error_handler.h" #include "net/base/ssl_info.h" -#include "net/base/x509_certificate.h" + +namespace net { +class X509Certificate; +} // A CertError represents an error that occurred with the certificate in an // SSL session. A CertError object exists both on the IO thread and on the UI @@ -38,7 +41,7 @@ class SSLCertErrorHandler : public SSLErrorHandler { virtual void OnDispatched(); private: - ~SSLCertErrorHandler() {} + virtual ~SSLCertErrorHandler(); // These read-only members may be accessed on any thread. net::SSLInfo ssl_info_; diff --git a/chrome/browser/ssl/ssl_client_auth_handler.h b/chrome/browser/ssl/ssl_client_auth_handler.h index 852467e..7cdc406 100644 --- a/chrome/browser/ssl/ssl_client_auth_handler.h +++ b/chrome/browser/ssl/ssl_client_auth_handler.h @@ -48,7 +48,7 @@ class SSLClientAuthHandler friend class ChromeThread; friend class DeleteTask<SSLClientAuthHandler>; - ~SSLClientAuthHandler(); + virtual ~SSLClientAuthHandler(); // Notifies that the user has selected a cert. // Called on the IO thread. diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc index 52792eb..3d37a21 100644 --- a/chrome/browser/ssl/ssl_error_handler.cc +++ b/chrome/browser/ssl/ssl_error_handler.cc @@ -46,6 +46,16 @@ SSLErrorHandler::SSLErrorHandler(ResourceDispatcherHost* rdh, AddRef(); } +SSLErrorHandler::~SSLErrorHandler() {} + +void SSLErrorHandler::OnDispatchFailed() { + TakeNoAction(); +} + +void SSLErrorHandler::OnDispatched() { + TakeNoAction(); +} + void SSLErrorHandler::Dispatch() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); diff --git a/chrome/browser/ssl/ssl_error_handler.h b/chrome/browser/ssl/ssl_error_handler.h index fde764b..383a9f8 100644 --- a/chrome/browser/ssl/ssl_error_handler.h +++ b/chrome/browser/ssl/ssl_error_handler.h @@ -93,13 +93,13 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> { const std::string& frame_origin, const std::string& main_frame_origin); - virtual ~SSLErrorHandler() { } + virtual ~SSLErrorHandler(); // The following 2 methods are the methods subclasses should implement. - virtual void OnDispatchFailed() { TakeNoAction(); } + virtual void OnDispatchFailed(); // Can use the manager_ member. - virtual void OnDispatched() { TakeNoAction(); } + virtual void OnDispatched(); // Should only be accessed on the UI thread. SSLManager* manager_; // Our manager. diff --git a/chrome/browser/tab_contents/background_contents.cc b/chrome/browser/tab_contents/background_contents.cc index ee459e1..5121d29 100644 --- a/chrome/browser/tab_contents/background_contents.cc +++ b/chrome/browser/tab_contents/background_contents.cc @@ -10,6 +10,7 @@ #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/site_instance.h" #include "chrome/browser/renderer_preferences_util.h" +#include "chrome/common/extensions/extension_constants.h" #include "chrome/common/notification_service.h" #include "chrome/common/url_constants.h" #include "chrome/common/view_types.h" @@ -46,23 +47,6 @@ BackgroundContents::BackgroundContents() render_view_host_(NULL) { } -void BackgroundContents::Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details) { - // TODO(rafaelw): Implement pagegroup ref-counting so that non-persistent - // background pages are closed when the last referencing frame is closed. - switch (type.value) { - case NotificationType::PROFILE_DESTROYED: - case NotificationType::APP_TERMINATING: { - delete this; - break; - } - default: - NOTREACHED() << "Unexpected notification sent."; - break; - } -} - BackgroundContents::~BackgroundContents() { if (!render_view_host_) // Will be null for unit tests. return; @@ -74,6 +58,14 @@ BackgroundContents::~BackgroundContents() { render_view_host_->Shutdown(); // deletes render_view_host } +ViewType::Type BackgroundContents::GetRenderViewType() const { + return ViewType::BACKGROUND_CONTENTS; +} + +int BackgroundContents::GetBrowserWindowID() const { + return extension_misc::kUnknownWindowId; +} + void BackgroundContents::DidNavigate( RenderViewHost* render_view_host, const ViewHostMsg_FrameNavigate_Params& params) { @@ -109,9 +101,27 @@ void BackgroundContents::RunJavaScriptMessage( *did_suppress_message = true; } -gfx::NativeWindow BackgroundContents::GetMessageBoxRootWindow() { - NOTIMPLEMENTED(); - return NULL; +bool BackgroundContents::PreHandleKeyboardEvent( + const NativeWebKeyboardEvent& event, + bool* is_keyboard_shortcut) { + return false; +} + +void BackgroundContents::Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details) { + // TODO(rafaelw): Implement pagegroup ref-counting so that non-persistent + // background pages are closed when the last referencing frame is closed. + switch (type.value) { + case NotificationType::PROFILE_DESTROYED: + case NotificationType::APP_TERMINATING: { + delete this; + break; + } + default: + NOTREACHED() << "Unexpected notification sent."; + break; + } } void BackgroundContents::OnMessageBoxClosed(IPC::Message* reply_msg, @@ -120,6 +130,11 @@ void BackgroundContents::OnMessageBoxClosed(IPC::Message* reply_msg, render_view_host_->JavaScriptMessageBoxClosed(reply_msg, success, prompt); } +gfx::NativeWindow BackgroundContents::GetMessageBoxRootWindow() { + NOTIMPLEMENTED(); + return NULL; +} + void BackgroundContents::Close(RenderViewHost* render_view_host) { Profile* profile = render_view_host->process()->profile(); NotificationService::current()->Notify( diff --git a/chrome/browser/tab_contents/background_contents.h b/chrome/browser/tab_contents/background_contents.h index f4cf75b..009dd0a 100644 --- a/chrome/browser/tab_contents/background_contents.h +++ b/chrome/browser/tab_contents/background_contents.h @@ -11,7 +11,6 @@ #include "chrome/browser/js_modal_dialog.h" #include "chrome/browser/renderer_host/render_view_host_delegate.h" #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" -#include "chrome/common/extensions/extension_constants.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/view_types.h" #include "chrome/common/window_container_type.h" @@ -60,12 +59,8 @@ class BackgroundContents : public RenderViewHostDelegate, // RenderViewHostDelegate implementation. virtual RenderViewHostDelegate::View* GetViewDelegate() { return this; } virtual const GURL& GetURL() const { return url_; } - virtual ViewType::Type GetRenderViewType() const { - return ViewType::BACKGROUND_CONTENTS; - } - virtual int GetBrowserWindowID() const { - return extension_misc::kUnknownWindowId; - } + virtual ViewType::Type GetRenderViewType() const; + virtual int GetBrowserWindowID() const; virtual void DidNavigate(RenderViewHost* render_view_host, const ViewHostMsg_FrameNavigate_Params& params); virtual WebPreferences GetWebkitPrefs(); @@ -106,9 +101,7 @@ class BackgroundContents : public RenderViewHostDelegate, virtual void Activate() {} virtual void Deactivate() {} virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, - bool* is_keyboard_shortcut) { - return false; - } + bool* is_keyboard_shortcut); virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {} virtual void HandleMouseMove() {} virtual void HandleMouseDown() {} diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc index 9626976..318312a 100644 --- a/chrome/common/child_process_host.cc +++ b/chrome/common/child_process_host.cc @@ -138,6 +138,10 @@ void ChildProcessHost::OnChildDied() { delete this; } +bool ChildProcessHost::InterceptMessageFromChild(const IPC::Message& msg) { + return false; +} + ChildProcessHost::ListenerHook::ListenerHook(ChildProcessHost* host) : host_(host) { } diff --git a/chrome/common/child_process_host.h b/chrome/common/child_process_host.h index 8eb050b..72438e8 100644 --- a/chrome/common/child_process_host.h +++ b/chrome/common/child_process_host.h @@ -93,9 +93,7 @@ class ChildProcessHost : public IPC::Channel::Listener { virtual void OnChildDied(); // Allows the derived implementation to intercept a message before it is // handed to the IPC::Channel::Listener::OnMessageReceived implementation. - virtual bool InterceptMessageFromChild(const IPC::Message& msg) { - return false; - } + virtual bool InterceptMessageFromChild(const IPC::Message& msg); // Subclasses can implement specific notification methods. virtual void Notify(NotificationType type) { } |