diff options
Diffstat (limited to 'chrome/browser')
93 files changed, 599 insertions, 298 deletions
diff --git a/chrome/browser/autofill/address_field.cc b/chrome/browser/autofill/address_field.cc index 41a1a1d..ea7dea7 100644 --- a/chrome/browser/autofill/address_field.cc +++ b/chrome/browser/autofill/address_field.cc @@ -70,6 +70,10 @@ bool AddressField::GetFieldInfo(FieldTypeMap* field_type_map) const { return ok; } +FormFieldType AddressField::GetFormFieldType() const { + return kAddressType; +} + AddressField* AddressField::Parse( std::vector<AutoFillField*>::const_iterator* iter, bool is_ecml) { diff --git a/chrome/browser/autofill/address_field.h b/chrome/browser/autofill/address_field.h index 51dd105..116ae35 100644 --- a/chrome/browser/autofill/address_field.h +++ b/chrome/browser/autofill/address_field.h @@ -16,7 +16,7 @@ class AutoFillField; class AddressField : public FormField { public: virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const; - virtual FormFieldType GetFormFieldType() const { return kAddressType; } + virtual FormFieldType GetFormFieldType() const; static AddressField* Parse(std::vector<AutoFillField*>::const_iterator* iter, bool is_ecml); diff --git a/chrome/browser/autofill/home_phone_number.cc b/chrome/browser/autofill/home_phone_number.cc new file mode 100644 index 0000000..f48efa8 --- /dev/null +++ b/chrome/browser/autofill/home_phone_number.cc @@ -0,0 +1,29 @@ +// 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/autofill/home_phone_number.h" + +FormGroup* HomePhoneNumber::Clone() const { + return new HomePhoneNumber(*this); +} + +AutoFillFieldType HomePhoneNumber::GetNumberType() const { + return PHONE_HOME_NUMBER; +} + +AutoFillFieldType HomePhoneNumber::GetCityCodeType() const { + return PHONE_HOME_CITY_CODE; +} + +AutoFillFieldType HomePhoneNumber::GetCountryCodeType() const { + return PHONE_HOME_COUNTRY_CODE; +} + +AutoFillFieldType HomePhoneNumber::GetCityAndNumberType() const { + return PHONE_HOME_CITY_AND_NUMBER; +} + +AutoFillFieldType HomePhoneNumber::GetWholeNumberType() const { + return PHONE_HOME_WHOLE_NUMBER; +} diff --git a/chrome/browser/autofill/home_phone_number.h b/chrome/browser/autofill/home_phone_number.h index e2aba0a..3e311e6 100644 --- a/chrome/browser/autofill/home_phone_number.h +++ b/chrome/browser/autofill/home_phone_number.h @@ -13,28 +13,14 @@ class FormGroup; class HomePhoneNumber : public PhoneNumber { public: HomePhoneNumber() {} - virtual FormGroup* Clone() const { return new HomePhoneNumber(*this); } + virtual FormGroup* Clone() const; protected: - virtual AutoFillFieldType GetNumberType() const { - return PHONE_HOME_NUMBER; - } - - virtual AutoFillFieldType GetCityCodeType() const { - return PHONE_HOME_CITY_CODE; - } - - virtual AutoFillFieldType GetCountryCodeType() const { - return PHONE_HOME_COUNTRY_CODE; - } - - virtual AutoFillFieldType GetCityAndNumberType() const { - return PHONE_HOME_CITY_AND_NUMBER; - } - - virtual AutoFillFieldType GetWholeNumberType() const { - return PHONE_HOME_WHOLE_NUMBER; - } + virtual AutoFillFieldType GetNumberType() const; + virtual AutoFillFieldType GetCityCodeType() const; + virtual AutoFillFieldType GetCountryCodeType() const; + virtual AutoFillFieldType GetCityAndNumberType() const; + virtual AutoFillFieldType GetWholeNumberType() const; private: explicit HomePhoneNumber(const HomePhoneNumber& phone) : PhoneNumber(phone) {} diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index c18cb1e..3d6d5be 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -1169,6 +1169,15 @@ AutomationProviderBookmarkModelObserver:: model_->RemoveObserver(this); } +void AutomationProviderBookmarkModelObserver::Loaded(BookmarkModel* model) { + ReplyAndDelete(true); +} + +void AutomationProviderBookmarkModelObserver::BookmarkModelBeingDeleted( + BookmarkModel* model) { + ReplyAndDelete(false); +} + void AutomationProviderBookmarkModelObserver::ReplyAndDelete(bool success) { AutomationMsg_WaitForBookmarkModelToLoad::WriteReplyParams( reply_message_, success); diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h index 2411bb9..a1773e2 100644 --- a/chrome/browser/automation/automation_provider_observers.h +++ b/chrome/browser/automation/automation_provider_observers.h @@ -648,12 +648,8 @@ class AutomationProviderBookmarkModelObserver : BookmarkModelObserver { BookmarkModel* model); virtual ~AutomationProviderBookmarkModelObserver(); - virtual void Loaded(BookmarkModel* model) { - ReplyAndDelete(true); - } - virtual void BookmarkModelBeingDeleted(BookmarkModel* model) { - ReplyAndDelete(false); - } + virtual void Loaded(BookmarkModel* model); + virtual void BookmarkModelBeingDeleted(BookmarkModel* model); virtual void BookmarkNodeMoved(BookmarkModel* model, const BookmarkNode* old_parent, int old_index, diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc index b962526..32b9d07 100644 --- a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc +++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc @@ -278,6 +278,12 @@ bool BookmarkContextMenuController::IsCommandIdEnabled(int command_id) const { return true; } +bool BookmarkContextMenuController::GetAcceleratorForCommandId( + int command_id, + menus::Accelerator* accelerator) { + return false; +} + void BookmarkContextMenuController::BookmarkModelChanged() { if (delegate_) delegate_->CloseMenu(); diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.h b/chrome/browser/bookmarks/bookmark_context_menu_controller.h index b047a1b..f5f04af 100644 --- a/chrome/browser/bookmarks/bookmark_context_menu_controller.h +++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.h @@ -60,9 +60,7 @@ class BookmarkContextMenuController : public BaseBookmarkModelObserver, virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator) { - return false; - } + menus::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); // Accessors: diff --git a/chrome/browser/diagnostics/diagnostics_test.cc b/chrome/browser/diagnostics/diagnostics_test.cc new file mode 100644 index 0000000..cd36c92 --- /dev/null +++ b/chrome/browser/diagnostics/diagnostics_test.cc @@ -0,0 +1,53 @@ +// 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/diagnostics/diagnostics_test.h" + +#include "base/file_path.h" +#include "base/path_service.h" +#include "chrome/common/chrome_constants.h" +#include "chrome/common/chrome_paths.h" + +DiagnosticTest::DiagnosticTest(const string16& title) + : title_(title), result_(DiagnosticsModel::TEST_NOT_RUN) { +} + +DiagnosticTest::~DiagnosticTest() { +} + +bool DiagnosticTest::Execute(DiagnosticsModel::Observer* observer, + DiagnosticsModel* model, + size_t index) { + result_ = DiagnosticsModel::TEST_RUNNING; + observer->OnProgress(index, 0, model); + bool keep_going = ExecuteImpl(observer); + observer->OnFinished(index, model); + return keep_going; +} + +string16 DiagnosticTest::GetTitle() { + return title_; +} + +DiagnosticsModel::TestResult DiagnosticTest::GetResult() { + return result_; +} + +string16 DiagnosticTest::GetAdditionalInfo() { + return additional_info_; +} + +void DiagnosticTest::RecordOutcome(const string16& additional_info, + DiagnosticsModel::TestResult result) { + additional_info_ = additional_info; + result_ = result; +} + +// static +FilePath DiagnosticTest::GetUserDefaultProfileDir() { + FilePath path; + if (!PathService::Get(chrome::DIR_USER_DATA, &path)) + return FilePath(); + return path.Append(FilePath::FromWStringHack(chrome::kNotSignedInProfile)); +} diff --git a/chrome/browser/diagnostics/diagnostics_test.h b/chrome/browser/diagnostics/diagnostics_test.h index 998a0d1..70d7eb7 100644 --- a/chrome/browser/diagnostics/diagnostics_test.h +++ b/chrome/browser/diagnostics/diagnostics_test.h @@ -6,12 +6,10 @@ #define CHROME_BROWSER_DIAGNOSTICS_DIAGNOSTICS_TEST_H_ #pragma once -#include "base/file_path.h" -#include "base/path_service.h" #include "base/string16.h" #include "chrome/browser/diagnostics/diagnostics_model.h" -#include "chrome/common/chrome_constants.h" -#include "chrome/common/chrome_paths.h" + +class FilePath; // Represents a single diagnostic test and encapsulates the common // functionality across platforms as well. @@ -27,33 +25,20 @@ class DiagnosticTest : public DiagnosticsModel::TestInfo { public: // |title| is the human readable, localized string that says that // the objective of the test is. - explicit DiagnosticTest(const string16& title) - : title_(title), result_(DiagnosticsModel::TEST_NOT_RUN) {} + explicit DiagnosticTest(const string16& title); - virtual ~DiagnosticTest() {} + virtual ~DiagnosticTest(); // Runs the test. Returning false signals that no more tests should be run. // The actual outcome of the test should be set using the RecordXX functions. bool Execute(DiagnosticsModel::Observer* observer, DiagnosticsModel* model, - size_t index) { - result_ = DiagnosticsModel::TEST_RUNNING; - observer->OnProgress(index, 0, model); - bool keep_going = ExecuteImpl(observer); - observer->OnFinished(index, model); - return keep_going; - } + size_t index); - virtual string16 GetTitle() { - return title_; - } + virtual string16 GetTitle(); - virtual DiagnosticsModel::TestResult GetResult() { - return result_; - } + virtual DiagnosticsModel::TestResult GetResult(); - virtual string16 GetAdditionalInfo() { - return additional_info_; - } + virtual string16 GetAdditionalInfo(); void RecordStopFailure(const string16& additional_info) { RecordOutcome(additional_info, DiagnosticsModel::TEST_FAIL_STOP); @@ -68,17 +53,9 @@ class DiagnosticTest : public DiagnosticsModel::TestInfo { } void RecordOutcome(const string16& additional_info, - DiagnosticsModel::TestResult result) { - additional_info_ = additional_info; - result_ = result; - } + DiagnosticsModel::TestResult result); - static FilePath GetUserDefaultProfileDir() { - FilePath path; - if (!PathService::Get(chrome::DIR_USER_DATA, &path)) - return FilePath(); - return path.Append(FilePath::FromWStringHack(chrome::kNotSignedInProfile)); - } + static FilePath GetUserDefaultProfileDir(); protected: // The id needs to be overriden by derived classes and must uniquely diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc index bda422b..f657fef 100644 --- a/chrome/browser/diagnostics/recon_diagnostics.cc +++ b/chrome/browser/diagnostics/recon_diagnostics.cc @@ -15,6 +15,7 @@ #include "base/path_service.h" #include "chrome/browser/diagnostics/diagnostics_test.h" #include "chrome/browser/platform_util.h" +#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/json_value_serializer.h" diff --git a/chrome/browser/dom_ui/dom_ui_screenshot_source.cc b/chrome/browser/dom_ui/dom_ui_screenshot_source.cc index db35499..110a52e 100644 --- a/chrome/browser/dom_ui/dom_ui_screenshot_source.cc +++ b/chrome/browser/dom_ui/dom_ui_screenshot_source.cc @@ -115,3 +115,9 @@ void DOMUIScreenshotSource::StartDataRequest(const std::string& path, int request_id) { SendResponse(request_id, new RefCountedBytes(GetScreenshot(path))); } + +std::string DOMUIScreenshotSource::GetMimeType(const std::string&) const { + // We need to explicitly return a mime type, otherwise if the user tries to + // drag the image they get no extension. + return "image/png"; +} diff --git a/chrome/browser/dom_ui/dom_ui_screenshot_source.h b/chrome/browser/dom_ui/dom_ui_screenshot_source.h index 8cd8b2c..3a9aafc 100644 --- a/chrome/browser/dom_ui/dom_ui_screenshot_source.h +++ b/chrome/browser/dom_ui/dom_ui_screenshot_source.h @@ -27,11 +27,7 @@ class DOMUIScreenshotSource : public ChromeURLDataManager::DataSource { bool is_off_the_record, int request_id); - virtual std::string GetMimeType(const std::string&) const { - // We need to explicitly return a mime type, otherwise if the user tries to - // drag the image they get no extension. - return "image/png"; - } + virtual std::string GetMimeType(const std::string&) const; std::vector<unsigned char> GetScreenshot(const std::string& path); diff --git a/chrome/browser/dom_ui/fileicon_source.cc b/chrome/browser/dom_ui/fileicon_source.cc index 7572cdc..a720df8 100644 --- a/chrome/browser/dom_ui/fileicon_source.cc +++ b/chrome/browser/dom_ui/fileicon_source.cc @@ -59,6 +59,11 @@ void FileIconSource::StartDataRequest(const std::string& path, } } +std::string FileIconSource::GetMimeType(const std::string&) const { + // Rely on image decoder inferring the correct type. + return std::string(); +} + void FileIconSource::OnFileIconDataAvailable(IconManager::Handle handle, SkBitmap* icon) { IconManager* im = g_browser_process->icon_manager(); diff --git a/chrome/browser/dom_ui/fileicon_source.h b/chrome/browser/dom_ui/fileicon_source.h index b8e1d2f..1bcf060 100644 --- a/chrome/browser/dom_ui/fileicon_source.h +++ b/chrome/browser/dom_ui/fileicon_source.h @@ -26,10 +26,7 @@ class FileIconSource : public ChromeURLDataManager::DataSource { bool is_off_the_record, int request_id); - virtual std::string GetMimeType(const std::string&) const { - // Rely on image decoder inferring the correct type. - return std::string(); - } + virtual std::string GetMimeType(const std::string&) const; // Called when favicon data is available from the history backend. void OnFileIconDataAvailable( diff --git a/chrome/browser/dom_ui/history2_ui.cc b/chrome/browser/dom_ui/history2_ui.cc index 3e9f67e..4001bb1 100644 --- a/chrome/browser/dom_ui/history2_ui.cc +++ b/chrome/browser/dom_ui/history2_ui.cc @@ -107,6 +107,10 @@ void HistoryUIHTMLSource2::StartDataRequest(const std::string& path, SendResponse(request_id, html_bytes); } +std::string HistoryUIHTMLSource2::GetMimeType(const std::string&) const { + return "text/html"; +} + //////////////////////////////////////////////////////////////////////////////// // // HistoryHandler diff --git a/chrome/browser/dom_ui/history2_ui.h b/chrome/browser/dom_ui/history2_ui.h index b38650e..a9e1d26 100644 --- a/chrome/browser/dom_ui/history2_ui.h +++ b/chrome/browser/dom_ui/history2_ui.h @@ -30,9 +30,7 @@ class HistoryUIHTMLSource2 : public ChromeURLDataManager::DataSource { bool is_off_the_record, int request_id); - virtual std::string GetMimeType(const std::string&) const { - return "text/html"; - } + virtual std::string GetMimeType(const std::string&) const; private: ~HistoryUIHTMLSource2() {} diff --git a/chrome/browser/dom_ui/options/options_ui.cc b/chrome/browser/dom_ui/options/options_ui.cc index ecf04b97..743f652 100644 --- a/chrome/browser/dom_ui/options/options_ui.cc +++ b/chrome/browser/dom_ui/options/options_ui.cc @@ -122,6 +122,10 @@ OptionsPageUIHandler::OptionsPageUIHandler() { OptionsPageUIHandler::~OptionsPageUIHandler() { } +bool OptionsPageUIHandler::IsEnabled() { + return true; +} + void OptionsPageUIHandler::UserMetricsRecordAction( const UserMetricsAction& action) { UserMetrics::RecordAction(action, dom_ui_->GetProfile()); diff --git a/chrome/browser/dom_ui/options/options_ui.h b/chrome/browser/dom_ui/options/options_ui.h index 9d412a3..ad1007d 100644 --- a/chrome/browser/dom_ui/options/options_ui.h +++ b/chrome/browser/dom_ui/options/options_ui.h @@ -47,7 +47,7 @@ class OptionsPageUIHandler : public DOMMessageHandler, virtual ~OptionsPageUIHandler(); // Is this handler enabled? - virtual bool IsEnabled() { return true; } + virtual bool IsEnabled(); // Collects localized strings for options page. virtual void GetLocalizedValues(DictionaryValue* localized_strings) = 0; diff --git a/chrome/browser/extensions/extension_infobar_delegate.cc b/chrome/browser/extensions/extension_infobar_delegate.cc index 77ed1af..3956563 100644 --- a/chrome/browser/extensions/extension_infobar_delegate.cc +++ b/chrome/browser/extensions/extension_infobar_delegate.cc @@ -38,6 +38,10 @@ ExtensionInfoBarDelegate::~ExtensionInfoBarDelegate() { observer_->OnDelegateDeleted(); } +void ExtensionInfoBarDelegate::InfoBarDismissed() { + closing_ = true; +} + bool ExtensionInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { ExtensionInfoBarDelegate* extension_delegate = delegate->AsExtensionInfoBarDelegate(); diff --git a/chrome/browser/extensions/extension_infobar_delegate.h b/chrome/browser/extensions/extension_infobar_delegate.h index e929fee..f286a11 100644 --- a/chrome/browser/extensions/extension_infobar_delegate.h +++ b/chrome/browser/extensions/extension_infobar_delegate.h @@ -37,7 +37,7 @@ class ExtensionInfoBarDelegate : public InfoBarDelegate, void set_observer(DelegateObserver* observer) { observer_ = observer; } // Overridden from InfoBarDelegate: - virtual void InfoBarDismissed() { closing_ = true; } + virtual void InfoBarDismissed(); virtual bool EqualsDelegate(InfoBarDelegate* delegate) const; virtual void InfoBarClosed(); virtual InfoBar* CreateInfoBar(); diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc index 990e093..630e5a9 100644 --- a/chrome/browser/extensions/extensions_ui.cc +++ b/chrome/browser/extensions/extensions_ui.cc @@ -191,6 +191,9 @@ void ExtensionsUIHTMLSource::StartDataRequest(const std::string& path, SendResponse(request_id, html_bytes); } +std::string ExtensionsUIHTMLSource::GetMimeType(const std::string&) const { + return "text/html"; +} //////////////////////////////////////////////////////////////////////////////// // @@ -676,6 +679,11 @@ void ExtensionsDOMHandler::FileSelected(const FilePath& path, int index, dom_ui_->CallJavascriptFunction(L"window.handleFilePathSelected", results); } +void ExtensionsDOMHandler::MultiFilesSelected( + const std::vector<FilePath>& files, void* params) { + NOTREACHED(); +} + void ExtensionsDOMHandler::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { diff --git a/chrome/browser/extensions/extensions_ui.h b/chrome/browser/extensions/extensions_ui.h index 54ec298..0caec5b 100644 --- a/chrome/browser/extensions/extensions_ui.h +++ b/chrome/browser/extensions/extensions_ui.h @@ -51,9 +51,7 @@ class ExtensionsUIHTMLSource : public ChromeURLDataManager::DataSource { virtual void StartDataRequest(const std::string& path, bool is_off_the_record, int request_id); - virtual std::string GetMimeType(const std::string&) const { - return "text/html"; - } + virtual std::string GetMimeType(const std::string&) const; private: ~ExtensionsUIHTMLSource() {} @@ -190,9 +188,7 @@ class ExtensionsDOMHandler virtual void FileSelected(const FilePath& path, int index, void* params); virtual void MultiFilesSelected( - const std::vector<FilePath>& files, void* params) { - NOTREACHED(); - } + const std::vector<FilePath>& files, void* params); virtual void FileSelectionCanceled(void* params) {} // NotificationObserver diff --git a/chrome/browser/gtk/download_shelf_gtk.cc b/chrome/browser/gtk/download_shelf_gtk.cc index ecce9aa..d9b5109 100644 --- a/chrome/browser/gtk/download_shelf_gtk.cc +++ b/chrome/browser/gtk/download_shelf_gtk.cc @@ -177,6 +177,10 @@ void DownloadShelfGtk::Close() { browser_->UpdateDownloadShelfVisibility(false); } +Browser* DownloadShelfGtk::browser() const { + return browser_; +} + void DownloadShelfGtk::Closed() { // When the close animation is complete, remove all completed downloads. size_t i = 0; diff --git a/chrome/browser/gtk/download_shelf_gtk.h b/chrome/browser/gtk/download_shelf_gtk.h index bd8ff0f..9c6cceb 100644 --- a/chrome/browser/gtk/download_shelf_gtk.h +++ b/chrome/browser/gtk/download_shelf_gtk.h @@ -40,7 +40,7 @@ class DownloadShelfGtk : public DownloadShelf, virtual bool IsClosing() const; virtual void Show(); virtual void Close(); - virtual Browser* browser() const { return browser_; } + virtual Browser* browser() const; // SlideAnimatorGtk::Delegate implementation. virtual void Closed(); diff --git a/chrome/browser/gtk/html_dialog_gtk.cc b/chrome/browser/gtk/html_dialog_gtk.cc index 2568e83..d0d18b2 100644 --- a/chrome/browser/gtk/html_dialog_gtk.cc +++ b/chrome/browser/gtk/html_dialog_gtk.cc @@ -93,6 +93,10 @@ void HtmlDialogGtk::OnDialogClosed(const std::string& json_retval) { delete this; } +bool HtmlDialogGtk::ShouldShowDialogTitle() const { + return true; +} + //////////////////////////////////////////////////////////////////////////////// // TabContentsDelegate implementation: diff --git a/chrome/browser/gtk/html_dialog_gtk.h b/chrome/browser/gtk/html_dialog_gtk.h index aba28f2..6b4ddda 100644 --- a/chrome/browser/gtk/html_dialog_gtk.h +++ b/chrome/browser/gtk/html_dialog_gtk.h @@ -46,7 +46,7 @@ class HtmlDialogGtk : public HtmlDialogTabContentsDelegate, 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; // Overridden from TabContentsDelegate: virtual void MoveContents(TabContents* source, const gfx::Rect& pos); diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc index 0602f3b..8ca86ce 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/gtk/location_bar_view_gtk.cc @@ -756,6 +756,10 @@ LocationBarTesting* LocationBarViewGtk::GetLocationBarForTesting() { return this; } +int LocationBarViewGtk::PageActionCount() { + return page_action_views_.size(); +} + int LocationBarViewGtk::PageActionVisibleCount() { int count = 0; gtk_container_foreach(GTK_CONTAINER(page_action_hbox_.get()), diff --git a/chrome/browser/gtk/location_bar_view_gtk.h b/chrome/browser/gtk/location_bar_view_gtk.h index e62c8ed..f1b1534 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.h +++ b/chrome/browser/gtk/location_bar_view_gtk.h @@ -130,7 +130,7 @@ class LocationBarViewGtk : public AutocompleteEditController, virtual LocationBarTesting* GetLocationBarForTesting(); // Implement the LocationBarTesting interface. - virtual int PageActionCount() { return page_action_views_.size(); } + virtual int PageActionCount(); virtual int PageActionVisibleCount(); virtual ExtensionAction* GetPageAction(size_t index); virtual ExtensionAction* GetVisiblePageAction(size_t index); diff --git a/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc b/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc index 530d215..5560662 100644 --- a/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc +++ b/chrome/browser/gtk/translate/translate_infobar_base_gtk.cc @@ -124,6 +124,10 @@ void TranslateInfoBarBase::AnimationProgressed(const Animation* animation) { gtk_widget_queue_draw(widget()); } +bool TranslateInfoBarBase::ShowOptionsMenuButton() const { + return false; +} + GtkWidget* TranslateInfoBarBase::CreateLabel(const std::string& text) { GtkWidget* label = gtk_label_new(text.c_str()); gtk_widget_modify_fg(label, GTK_STATE_NORMAL, >k_util::kGdkBlack); diff --git a/chrome/browser/gtk/translate/translate_infobar_base_gtk.h b/chrome/browser/gtk/translate/translate_infobar_base_gtk.h index 8b2303b..ae147ca 100644 --- a/chrome/browser/gtk/translate/translate_infobar_base_gtk.h +++ b/chrome/browser/gtk/translate/translate_infobar_base_gtk.h @@ -43,7 +43,7 @@ class TranslateInfoBarBase : public TranslateInfoBarView, protected: // Sub-classes that want to have the options menu button showing sould // override and return true. - virtual bool ShowOptionsMenuButton() const { return false; } + virtual bool ShowOptionsMenuButton() const; // Creates a label with the appropriate font and color for the translate // infobars. diff --git a/chrome/browser/modal_html_dialog_delegate.cc b/chrome/browser/modal_html_dialog_delegate.cc index 715edd9..09b4c4a1 100644 --- a/chrome/browser/modal_html_dialog_delegate.cc +++ b/chrome/browser/modal_html_dialog_delegate.cc @@ -42,6 +42,10 @@ bool ModalHtmlDialogDelegate::IsDialogModal() const { return true; } +std::wstring ModalHtmlDialogDelegate::GetDialogTitle() const { + return L"Gears"; +} + GURL ModalHtmlDialogDelegate::GetDialogContentURL() const { return params_.url; } diff --git a/chrome/browser/modal_html_dialog_delegate.h b/chrome/browser/modal_html_dialog_delegate.h index 23bb0f7..9336b3b 100644 --- a/chrome/browser/modal_html_dialog_delegate.h +++ b/chrome/browser/modal_html_dialog_delegate.h @@ -39,7 +39,7 @@ class ModalHtmlDialogDelegate // HTMLDialogUIDelegate implementation: virtual bool IsDialogModal() const; - virtual std::wstring GetDialogTitle() const { return L"Gears"; } + virtual std::wstring GetDialogTitle() const; virtual GURL GetDialogContentURL() const; virtual void GetDOMMessageHandlers( std::vector<DOMMessageHandler*>* handlers) const { } diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc index df661e4..aeb6a00 100644 --- a/chrome/browser/nacl_host/nacl_process_host.cc +++ b/chrome/browser/nacl_host/nacl_process_host.cc @@ -292,6 +292,10 @@ URLRequestContext* NaClProcessHost::GetRequestContext( return NULL; } +bool NaClProcessHost::CanShutdown() { + return true; +} + #if defined(OS_WIN) // TODO(gregoryd): invoke CheckIsWow64 only once, not for each NaClProcessHost typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); diff --git a/chrome/browser/nacl_host/nacl_process_host.h b/chrome/browser/nacl_host/nacl_process_host.h index 5d6cc35..86bd614 100644 --- a/chrome/browser/nacl_host/nacl_process_host.h +++ b/chrome/browser/nacl_host/nacl_process_host.h @@ -52,7 +52,7 @@ class NaClProcessHost : public BrowserChildProcessHost { uint32 request_id, const ViewHostMsg_Resource_Request& request_data); - virtual bool CanShutdown() { return true; } + virtual bool CanShutdown(); #if defined(OS_WIN) // Check whether the browser process is running on WOW64 - Windows only diff --git a/chrome/browser/net/url_request_slow_download_job.cc b/chrome/browser/net/url_request_slow_download_job.cc index b5d7de1..d10591d 100644 --- a/chrome/browser/net/url_request_slow_download_job.cc +++ b/chrome/browser/net/url_request_slow_download_job.cc @@ -142,6 +142,8 @@ void URLRequestSlowDownloadJob::GetResponseInfo(net::HttpResponseInfo* info) { GetResponseInfoConst(info); } +URLRequestSlowDownloadJob::~URLRequestSlowDownloadJob() {} + // Private const version. void URLRequestSlowDownloadJob::GetResponseInfoConst( net::HttpResponseInfo* info) const { diff --git a/chrome/browser/net/url_request_slow_download_job.h b/chrome/browser/net/url_request_slow_download_job.h index ca4a23d..d6927b8 100644 --- a/chrome/browser/net/url_request_slow_download_job.h +++ b/chrome/browser/net/url_request_slow_download_job.h @@ -41,7 +41,7 @@ class URLRequestSlowDownloadJob : public net::URLRequestJob { static void AddUrlHandler(); private: - virtual ~URLRequestSlowDownloadJob() { } + virtual ~URLRequestSlowDownloadJob(); void GetResponseInfoConst(net::HttpResponseInfo* info) const; diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index 13b092f..86a279b 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -193,6 +193,11 @@ void BalloonHost::ShowCreatedWindow(int route_id, browser->AddTabContents(contents, disposition, initial_pos, user_gesture); } +bool BalloonHost::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, + bool* is_keyboard_shortcut) { + return false; +} + void BalloonHost::UpdatePreferredSize(const gfx::Size& new_size) { balloon_->SetContentPreferredSize(new_size); } diff --git a/chrome/browser/notifications/balloon_host.h b/chrome/browser/notifications/balloon_host.h index c3c058b..358cb61 100644 --- a/chrome/browser/notifications/balloon_host.h +++ b/chrome/browser/notifications/balloon_host.h @@ -95,9 +95,7 @@ class BalloonHost : 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/browser/plugin_exceptions_table_model.cc b/chrome/browser/plugin_exceptions_table_model.cc index c690908..7ad5b13 100644 --- a/chrome/browser/plugin_exceptions_table_model.cc +++ b/chrome/browser/plugin_exceptions_table_model.cc @@ -102,6 +102,10 @@ std::wstring PluginExceptionsTableModel::GetText(int row, int column_id) { return std::wstring(); } +bool PluginExceptionsTableModel::HasGroups() { + return true; +} + void PluginExceptionsTableModel::SetObserver(TableModelObserver* observer) { observer_ = observer; } diff --git a/chrome/browser/plugin_exceptions_table_model.h b/chrome/browser/plugin_exceptions_table_model.h index d9f8e40..d345b95 100644 --- a/chrome/browser/plugin_exceptions_table_model.h +++ b/chrome/browser/plugin_exceptions_table_model.h @@ -37,7 +37,7 @@ class PluginExceptionsTableModel : public RemoveRowsTableModel, virtual int RowCount(); virtual std::wstring GetText(int row, int column_id); virtual void SetObserver(TableModelObserver* observer); - virtual bool HasGroups() { return true; } + virtual bool HasGroups(); virtual Groups GetGroups(); virtual int GetGroupID(int row); @@ -54,10 +54,10 @@ class PluginExceptionsTableModel : public RemoveRowsTableModel, friend class PluginExceptionsTableModelTest; struct SettingsEntry { - ContentSettingsPattern pattern; - int plugin_id; - ContentSetting setting; - bool is_otr; + ContentSettingsPattern pattern; + int plugin_id; + ContentSetting setting; + bool is_otr; }; void ClearSettings(); diff --git a/chrome/browser/policy/asynchronous_policy_loader.cc b/chrome/browser/policy/asynchronous_policy_loader.cc index cca7212..e78c9aa 100644 --- a/chrome/browser/policy/asynchronous_policy_loader.cc +++ b/chrome/browser/policy/asynchronous_policy_loader.cc @@ -28,6 +28,9 @@ void AsynchronousPolicyLoader::SetProvider( provider_ = provider; } +AsynchronousPolicyLoader::~AsynchronousPolicyLoader() { +} + // Manages the life cycle of a new policy map during until it's life cycle is // taken over by the policy loader. class UpdatePolicyTask : public Task { diff --git a/chrome/browser/policy/asynchronous_policy_loader.h b/chrome/browser/policy/asynchronous_policy_loader.h index 30878f5..d88cdff 100644 --- a/chrome/browser/policy/asynchronous_policy_loader.h +++ b/chrome/browser/policy/asynchronous_policy_loader.h @@ -45,7 +45,7 @@ class AsynchronousPolicyLoader // AsynchronousPolicyLoader objects should only be deleted by // RefCountedThreadSafe. friend class base::RefCountedThreadSafe<AsynchronousPolicyLoader>; - virtual ~AsynchronousPolicyLoader() {} + virtual ~AsynchronousPolicyLoader(); // Schedules a call to UpdatePolicy on |origin_loop_|. Takes ownership of // |new_policy|. diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc index 0259ed4..c777e35 100644 --- a/chrome/browser/policy/configuration_policy_pref_store.cc +++ b/chrome/browser/policy/configuration_policy_pref_store.cc @@ -348,6 +348,10 @@ PrefStore::ReadResult ConfigurationPolicyPrefStore::GetValue( return READ_OK; } +DictionaryValue* ConfigurationPolicyPrefStore::prefs() const { + return prefs_.get(); +} + void ConfigurationPolicyPrefStore::Apply(ConfigurationPolicyType policy, Value* value) { if (ApplyProxyPolicy(policy, value)) diff --git a/chrome/browser/policy/configuration_policy_pref_store.h b/chrome/browser/policy/configuration_policy_pref_store.h index 2ce8c61..820306a 100644 --- a/chrome/browser/policy/configuration_policy_pref_store.h +++ b/chrome/browser/policy/configuration_policy_pref_store.h @@ -36,7 +36,7 @@ class ConfigurationPolicyPrefStore : public PrefStore, // PrefStore methods: virtual ReadResult GetValue(const std::string& key, Value** result) const; - virtual DictionaryValue* prefs() const { return prefs_.get(); } + virtual DictionaryValue* prefs() const; // ConfigurationPolicyStore methods: virtual void Apply(ConfigurationPolicyType setting, Value* value); diff --git a/chrome/browser/policy/file_based_policy_loader.cc b/chrome/browser/policy/file_based_policy_loader.cc index 4c33b91..947008b 100644 --- a/chrome/browser/policy/file_based_policy_loader.cc +++ b/chrome/browser/policy/file_based_policy_loader.cc @@ -81,6 +81,8 @@ void FileBasedPolicyLoader::OnError() { << " failed."; } +FileBasedPolicyLoader::~FileBasedPolicyLoader() {} + void FileBasedPolicyLoader::Reload() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); diff --git a/chrome/browser/policy/file_based_policy_loader.h b/chrome/browser/policy/file_based_policy_loader.h index 8acf9b2d..c1b32f2 100644 --- a/chrome/browser/policy/file_based_policy_loader.h +++ b/chrome/browser/policy/file_based_policy_loader.h @@ -33,7 +33,7 @@ class FileBasedPolicyLoader : public AsynchronousPolicyLoader { // FileBasedPolicyLoader objects should only be deleted by // RefCountedThreadSafe. friend class base::RefCountedThreadSafe<AsynchronousPolicyLoader>; - virtual ~FileBasedPolicyLoader() {} + virtual ~FileBasedPolicyLoader(); const FilePath& config_file_path() { return config_file_path_; } diff --git a/chrome/browser/prefs/pref_value_map.cc b/chrome/browser/prefs/pref_value_map.cc index 8d37f2b..ff27049 100644 --- a/chrome/browser/prefs/pref_value_map.cc +++ b/chrome/browser/prefs/pref_value_map.cc @@ -9,6 +9,8 @@ #include "base/stl_util-inl.h" #include "base/values.h" +PrefValueMap::PrefValueMap() {} + PrefValueMap::~PrefValueMap() { Clear(); } diff --git a/chrome/browser/prefs/pref_value_map.h b/chrome/browser/prefs/pref_value_map.h index 26b6214..ddcddf2 100644 --- a/chrome/browser/prefs/pref_value_map.h +++ b/chrome/browser/prefs/pref_value_map.h @@ -16,7 +16,7 @@ class Value; // A generic string to value map used by the PrefStore implementations. class PrefValueMap { public: - PrefValueMap() {} + PrefValueMap(); virtual ~PrefValueMap(); // Gets the value for |key| and stores it in |value|. Ownership remains with diff --git a/chrome/browser/prefs/value_map_pref_store.cc b/chrome/browser/prefs/value_map_pref_store.cc index 82574b2..705c958 100644 --- a/chrome/browser/prefs/value_map_pref_store.cc +++ b/chrome/browser/prefs/value_map_pref_store.cc @@ -9,6 +9,10 @@ #include "base/stl_util-inl.h" #include "base/values.h" +ValueMapPrefStore::ValueMapPrefStore() {} + +ValueMapPrefStore::~ValueMapPrefStore() {} + PrefStore::ReadResult ValueMapPrefStore::GetValue(const std::string& key, Value** value) const { return prefs_.GetValue(key, value) ? READ_OK : READ_NO_VALUE; diff --git a/chrome/browser/prefs/value_map_pref_store.h b/chrome/browser/prefs/value_map_pref_store.h index dbfba80..20bf2902 100644 --- a/chrome/browser/prefs/value_map_pref_store.h +++ b/chrome/browser/prefs/value_map_pref_store.h @@ -17,8 +17,8 @@ // storing the preference values. class ValueMapPrefStore : public PrefStore { public: - ValueMapPrefStore() {} - virtual ~ValueMapPrefStore() {} + ValueMapPrefStore(); + virtual ~ValueMapPrefStore(); // PrefStore overrides: virtual ReadResult GetValue(const std::string& key, Value** value) const; diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc index fbd0dc6..fddff26 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc @@ -165,19 +165,23 @@ std::string CloudPrintSetupFlow::GetDialogArgs() const { return dialog_start_args_; } -void CloudPrintSetupFlow::OnCloseContents(TabContents* source, - bool* out_close_dialog) { +void CloudPrintSetupFlow::OnCloseContents(TabContents* source, + bool* out_close_dialog) { } -std::wstring CloudPrintSetupFlow::GetDialogTitle() const { +std::wstring CloudPrintSetupFlow::GetDialogTitle() const { return l10n_util::GetString(IDS_CLOUD_PRINT_SETUP_DIALOG_TITLE); } -bool CloudPrintSetupFlow::IsDialogModal() const { +bool CloudPrintSetupFlow::IsDialogModal() const { // We are always modeless. return false; } +bool CloudPrintSetupFlow::ShouldShowDialogTitle() const { + return true; +} + /////////////////////////////////////////////////////////////////////////////// // GaiaAuthConsumer implementation. void CloudPrintSetupFlow::OnClientLoginFailure( diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h index 14354e3..86077ab 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h @@ -70,7 +70,7 @@ class CloudPrintSetupFlow : public HtmlDialogUIDelegate, virtual void OnCloseContents(TabContents* source, bool* out_close_dialog); virtual std::wstring GetDialogTitle() const; virtual bool IsDialogModal() const; - virtual bool ShouldShowDialogTitle() const { return true; } + virtual bool ShouldShowDialogTitle() const; // GaiaAuthConsumer implementation. virtual void OnClientLoginFailure( diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc index a19ade2..972f088 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc @@ -126,6 +126,10 @@ void CloudPrintSetupSource::StartDataRequest(const std::string& path_raw, SendResponse(request_id, html_bytes); } +std::string CloudPrintSetupSource::GetMimeType(const std::string& path) const { + return "text/html"; +} + std::string CloudPrintSetupSource::GetLocalizedUrl( const std::string& url) const { GURL original_url(url); diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_source.h b/chrome/browser/printing/cloud_print/cloud_print_setup_source.h index 3fa3048..7050c5e 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_source.h +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_source.h @@ -18,9 +18,7 @@ class CloudPrintSetupSource : public ChromeURLDataManager::DataSource { bool is_off_the_record, int request_id); - virtual std::string GetMimeType(const std::string& path) const { - return "text/html"; - } + virtual std::string GetMimeType(const std::string& path) const; static const char kInvalidPasswordHelpUrl[]; static const char kCanNotAccessAccountUrl[]; diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc index df9df0f..c67b8f5 100644 --- a/chrome/browser/printing/print_job.cc +++ b/chrome/browser/printing/print_job.cc @@ -86,6 +86,14 @@ PrintJobWorker* PrintJob::DetachWorker(PrintJobWorkerOwner* new_owner) { return NULL; } +MessageLoop* PrintJob::message_loop() { + return ui_message_loop_; +} + +const PrintSettings& PrintJob::settings() const { + return settings_; +} + int PrintJob::cookie() const { if (!document_.get()) // Always use an invalid cookie in this case. diff --git a/chrome/browser/printing/print_job.h b/chrome/browser/printing/print_job.h index e78f1a9..03aacda 100644 --- a/chrome/browser/printing/print_job.h +++ b/chrome/browser/printing/print_job.h @@ -54,8 +54,8 @@ class PrintJob : public PrintJobWorkerOwner, virtual void GetSettingsDone(const PrintSettings& new_settings, PrintingContext::Result result); virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner); - virtual MessageLoop* message_loop() { return ui_message_loop_; } - virtual const PrintSettings& settings() const { return settings_; } + virtual MessageLoop* message_loop(); + virtual const PrintSettings& settings() const; virtual int cookie() const; // DestructionObserver diff --git a/chrome/browser/printing/printer_query.cc b/chrome/browser/printing/printer_query.cc index 7b73d86..87ec00f 100644 --- a/chrome/browser/printing/printer_query.cc +++ b/chrome/browser/printing/printer_query.cc @@ -58,6 +58,18 @@ PrintJobWorker* PrinterQuery::DetachWorker(PrintJobWorkerOwner* new_owner) { return worker_.release(); } +MessageLoop* PrinterQuery::message_loop() { + return io_message_loop_; +} + +const PrintSettings& PrinterQuery::settings() const { + return settings_; +} + +int PrinterQuery::cookie() const { + return cookie_; +} + void PrinterQuery::GetSettings(GetSettingsAskParam ask_user_for_settings, gfx::NativeView parent_view, int expected_page_count, diff --git a/chrome/browser/printing/printer_query.h b/chrome/browser/printing/printer_query.h index 470eff7..dc18b1f 100644 --- a/chrome/browser/printing/printer_query.h +++ b/chrome/browser/printing/printer_query.h @@ -36,12 +36,9 @@ class PrinterQuery : public PrintJobWorkerOwner { virtual void GetSettingsDone(const PrintSettings& new_settings, PrintingContext::Result result); virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner); - virtual MessageLoop* message_loop() { - return io_message_loop_; - } - virtual const PrintSettings& settings() const { return settings_; } - - virtual int cookie() const { return cookie_; } + virtual MessageLoop* message_loop(); + virtual const PrintSettings& settings() const; + virtual int cookie() const; // Initializes the printing context. It is fine to call this function multiple // times to reinitialize the settings. |parent_view| parameter's window will diff --git a/chrome/browser/remoting/remoting_resources_source.cc b/chrome/browser/remoting/remoting_resources_source.cc index 1af7a2a9..9057e1d 100644 --- a/chrome/browser/remoting/remoting_resources_source.cc +++ b/chrome/browser/remoting/remoting_resources_source.cc @@ -113,6 +113,11 @@ void RemotingResourcesSource::StartDataRequest(const std::string& path_raw, SendResponse(request_id, html_bytes); } +std::string RemotingResourcesSource::GetMimeType( + const std::string& path) const { + return "text/html"; +} + std::string RemotingResourcesSource::GetLocalizedUrl( const std::string& url) const { GURL original_url(url); diff --git a/chrome/browser/remoting/remoting_resources_source.h b/chrome/browser/remoting/remoting_resources_source.h index 96d1b4d..4d73d8e 100644 --- a/chrome/browser/remoting/remoting_resources_source.h +++ b/chrome/browser/remoting/remoting_resources_source.h @@ -13,9 +13,7 @@ class RemotingResourcesSource : public ChromeURLDataManager::DataSource { bool is_off_the_record, int request_id); - virtual std::string GetMimeType(const std::string& path) const { - return "text/html"; - } + virtual std::string GetMimeType(const std::string& path) const; static const char kInvalidPasswordHelpUrl[]; static const char kCanNotAccessAccountUrl[]; diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index cf3418a..e90e096 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -531,6 +531,10 @@ void RenderWidgetHostViewGtk::InitAsFullscreen( DoInitAsPopup(parent_host_view, GTK_WINDOW_TOPLEVEL, gfx::Rect(), true); } +RenderWidgetHost* RenderWidgetHostViewGtk::GetRenderWidgetHost() const { + return host_; +} + void RenderWidgetHostViewGtk::DidBecomeSelected() { if (!is_hidden_) return; diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.h b/chrome/browser/renderer_host/render_widget_host_view_gtk.h index 7af66f8..9f9b2e2 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.h +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.h @@ -55,7 +55,7 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView, virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, const gfx::Rect& pos); virtual void InitAsFullscreen(RenderWidgetHostView* parent_host_view); - virtual RenderWidgetHost* GetRenderWidgetHost() const { return host_; } + virtual RenderWidgetHost* GetRenderWidgetHost() const; virtual void DidBecomeSelected(); virtual void WasHidden(); virtual void SetSize(const gfx::Size& size); diff --git a/chrome/browser/safe_browsing/safe_browsing_store_sqlite.cc b/chrome/browser/safe_browsing/safe_browsing_store_sqlite.cc index cf3369a..c9cf026 100644 --- a/chrome/browser/safe_browsing/safe_browsing_store_sqlite.cc +++ b/chrome/browser/safe_browsing/safe_browsing_store_sqlite.cc @@ -84,6 +84,10 @@ void SafeBrowsingStoreSqlite::Init(const FilePath& filename, corruption_callback_.reset(corruption_callback); } +bool SafeBrowsingStoreSqlite::BeginChunk() { + return true; +} + bool SafeBrowsingStoreSqlite::GetAddPrefixes( std::vector<SBAddPrefix>* add_prefixes) { add_prefixes->clear(); @@ -93,6 +97,39 @@ bool SafeBrowsingStoreSqlite::GetAddPrefixes( return ret; } +bool SafeBrowsingStoreSqlite::WriteAddPrefix(int32 chunk_id, SBPrefix prefix) { + const std::vector<SBAddPrefix> prefixes(1, SBAddPrefix(chunk_id, prefix)); + return WriteAddPrefixes(prefixes); +} + +bool SafeBrowsingStoreSqlite::WriteAddHash(int32 chunk_id, + base::Time receive_time, + const SBFullHash& full_hash) { + const std::vector<SBAddFullHash> + hashes(1, SBAddFullHash(chunk_id, receive_time, full_hash)); + return WriteAddHashes(hashes); +} + +bool SafeBrowsingStoreSqlite::WriteSubPrefix(int32 chunk_id, + int32 add_chunk_id, + SBPrefix prefix) { + const std::vector<SBSubPrefix> + prefixes(1, SBSubPrefix(chunk_id, add_chunk_id, prefix)); + return WriteSubPrefixes(prefixes); +} + +bool SafeBrowsingStoreSqlite::WriteSubHash(int32 chunk_id, + int32 add_chunk_id, + const SBFullHash& full_hash) { + const std::vector<SBSubFullHash> + hashes(1, SBSubFullHash(chunk_id, add_chunk_id, full_hash)); + return WriteSubHashes(hashes); +} + +bool SafeBrowsingStoreSqlite::FinishChunk() { + return true; +} + bool SafeBrowsingStoreSqlite::OnCorruptDatabase() { if (corruption_callback_.get()) corruption_callback_->Run(); @@ -670,3 +707,43 @@ bool SafeBrowsingStoreSqlite::FinishUpdate( bool SafeBrowsingStoreSqlite::CancelUpdate() { return Close(); } + +void SafeBrowsingStoreSqlite::SetAddChunk(int32 chunk_id) { + add_chunks_cache_.insert(chunk_id); +} + +bool SafeBrowsingStoreSqlite::CheckAddChunk(int32 chunk_id) { + return add_chunks_cache_.count(chunk_id) > 0; +} + +void SafeBrowsingStoreSqlite::GetAddChunks(std::vector<int32>* out) { + out->clear(); + out->insert(out->end(), add_chunks_cache_.begin(), add_chunks_cache_.end()); +} + +void SafeBrowsingStoreSqlite::SetSubChunk(int32 chunk_id) { + sub_chunks_cache_.insert(chunk_id); +} + +bool SafeBrowsingStoreSqlite::CheckSubChunk(int32 chunk_id) { + return sub_chunks_cache_.count(chunk_id) > 0; +} + +void SafeBrowsingStoreSqlite::GetSubChunks(std::vector<int32>* out) { + out->clear(); + out->insert(out->end(), sub_chunks_cache_.begin(), sub_chunks_cache_.end()); +} + +void SafeBrowsingStoreSqlite::DeleteAddChunk(int32 chunk_id) { + add_del_cache_.insert(chunk_id); +} + +void SafeBrowsingStoreSqlite::DeleteSubChunk(int32 chunk_id) { + sub_del_cache_.insert(chunk_id); +} + +// static +const FilePath SafeBrowsingStoreSqlite::JournalFileForFilename( + const FilePath& filename) { + return FilePath(filename.value() + FILE_PATH_LITERAL("-journal")); +} diff --git a/chrome/browser/safe_browsing/safe_browsing_store_sqlite.h b/chrome/browser/safe_browsing/safe_browsing_store_sqlite.h index b577b08..f9d4381 100644 --- a/chrome/browser/safe_browsing/safe_browsing_store_sqlite.h +++ b/chrome/browser/safe_browsing/safe_browsing_store_sqlite.h @@ -29,38 +29,19 @@ class SafeBrowsingStoreSqlite : public SafeBrowsingStore { virtual void Init(const FilePath& filename, Callback0::Type* corruption_callback); - virtual bool BeginChunk() { - return true; - } + virtual bool BeginChunk(); // Get all Add prefixes out from the store. virtual bool GetAddPrefixes(std::vector<SBAddPrefix>* add_prefixes); - virtual bool WriteAddPrefix(int32 chunk_id, SBPrefix prefix) { - const std::vector<SBAddPrefix> prefixes(1, SBAddPrefix(chunk_id, prefix)); - return WriteAddPrefixes(prefixes); - } + virtual bool WriteAddPrefix(int32 chunk_id, SBPrefix prefix); virtual bool WriteAddHash(int32 chunk_id, base::Time receive_time, - const SBFullHash& full_hash) { - const std::vector<SBAddFullHash> - hashes(1, SBAddFullHash(chunk_id, receive_time, full_hash)); - return WriteAddHashes(hashes); - } + const SBFullHash& full_hash); virtual bool WriteSubPrefix(int32 chunk_id, - int32 add_chunk_id, SBPrefix prefix) { - const std::vector<SBSubPrefix> - prefixes(1, SBSubPrefix(chunk_id, add_chunk_id, prefix)); - return WriteSubPrefixes(prefixes); - } + int32 add_chunk_id, SBPrefix prefix); virtual bool WriteSubHash(int32 chunk_id, int32 add_chunk_id, - const SBFullHash& full_hash) { - const std::vector<SBSubFullHash> - hashes(1, SBSubFullHash(chunk_id, add_chunk_id, full_hash)); - return WriteSubHashes(hashes); - } - virtual bool FinishChunk() { - return true; - } + const SBFullHash& full_hash); + virtual bool FinishChunk(); virtual bool BeginUpdate(); // TODO(shess): Should not be public. @@ -75,40 +56,20 @@ class SafeBrowsingStoreSqlite : public SafeBrowsingStore { std::vector<SBAddFullHash>* add_full_hashes_result); virtual bool CancelUpdate(); - virtual void SetAddChunk(int32 chunk_id) { - add_chunks_cache_.insert(chunk_id); - } - virtual bool CheckAddChunk(int32 chunk_id) { - return add_chunks_cache_.count(chunk_id) > 0; - } - virtual void GetAddChunks(std::vector<int32>* out) { - out->clear(); - out->insert(out->end(), add_chunks_cache_.begin(), add_chunks_cache_.end()); - } - - virtual void SetSubChunk(int32 chunk_id) { - sub_chunks_cache_.insert(chunk_id); - } - virtual bool CheckSubChunk(int32 chunk_id) { - return sub_chunks_cache_.count(chunk_id) > 0; - } - virtual void GetSubChunks(std::vector<int32>* out) { - out->clear(); - out->insert(out->end(), sub_chunks_cache_.begin(), sub_chunks_cache_.end()); - } - - virtual void DeleteAddChunk(int32 chunk_id) { - add_del_cache_.insert(chunk_id); - } - virtual void DeleteSubChunk(int32 chunk_id) { - sub_del_cache_.insert(chunk_id); - } + virtual void SetAddChunk(int32 chunk_id); + virtual bool CheckAddChunk(int32 chunk_id); + virtual void GetAddChunks(std::vector<int32>* out); + + virtual void SetSubChunk(int32 chunk_id); + virtual bool CheckSubChunk(int32 chunk_id); + virtual void GetSubChunks(std::vector<int32>* out); + + virtual void DeleteAddChunk(int32 chunk_id); + virtual void DeleteSubChunk(int32 chunk_id); // Returns the name of the SQLite journal file for |filename|. // Exported for unit tests. - static const FilePath JournalFileForFilename(const FilePath& filename) { - return FilePath(filename.value() + FILE_PATH_LITERAL("-journal")); - } + static const FilePath JournalFileForFilename(const FilePath& filename); private: // For on-the-fly migration. diff --git a/chrome/browser/ssl/ssl_cert_error_handler.cc b/chrome/browser/ssl/ssl_cert_error_handler.cc index 40bf067..97b0e05 100644 --- a/chrome/browser/ssl/ssl_cert_error_handler.cc +++ b/chrome/browser/ssl/ssl_cert_error_handler.cc @@ -28,6 +28,10 @@ SSLCertErrorHandler::SSLCertErrorHandler( ssl_info_.SetCertError(cert_error); } +SSLCertErrorHandler* SSLCertErrorHandler::AsSSLCertErrorHandler() { + return this; +} + void SSLCertErrorHandler::OnDispatchFailed() { CancelRequest(); } diff --git a/chrome/browser/ssl/ssl_cert_error_handler.h b/chrome/browser/ssl/ssl_cert_error_handler.h index a4bdd0d..4f71999 100644 --- a/chrome/browser/ssl/ssl_cert_error_handler.h +++ b/chrome/browser/ssl/ssl_cert_error_handler.h @@ -29,7 +29,7 @@ class SSLCertErrorHandler : public SSLErrorHandler { int cert_error, net::X509Certificate* cert); - virtual SSLCertErrorHandler* AsSSLCertErrorHandler() { return this; } + virtual SSLCertErrorHandler* AsSSLCertErrorHandler(); // These accessors are available on either thread const net::SSLInfo& ssl_info() const { return ssl_info_; } diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc index 7f90bac..0bc04d8 100644 --- a/chrome/browser/ssl/ssl_error_handler.cc +++ b/chrome/browser/ssl/ssl_error_handler.cc @@ -56,6 +56,10 @@ void SSLErrorHandler::OnDispatched() { TakeNoAction(); } +SSLCertErrorHandler* SSLErrorHandler::AsSSLCertErrorHandler() { + return NULL; +} + 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 7d4a9cf..578429c 100644 --- a/chrome/browser/ssl/ssl_error_handler.h +++ b/chrome/browser/ssl/ssl_error_handler.h @@ -39,7 +39,7 @@ class URLRequest; // class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> { public: - virtual SSLCertErrorHandler* AsSSLCertErrorHandler() { return NULL; } + virtual SSLCertErrorHandler* AsSSLCertErrorHandler(); // Find the appropriate SSLManager for the net::URLRequest and begin handling // this error. diff --git a/chrome/browser/sync/glue/app_data_type_controller.cc b/chrome/browser/sync/glue/app_data_type_controller.cc index cbadb80..d26b5fa 100644 --- a/chrome/browser/sync/glue/app_data_type_controller.cc +++ b/chrome/browser/sync/glue/app_data_type_controller.cc @@ -84,6 +84,27 @@ void AppDataTypeController::Stop() { state_ = NOT_RUNNING; } +bool AppDataTypeController::enabled() { + return true; +} + +syncable::ModelType AppDataTypeController::type() { + return syncable::APPS; +} + +browser_sync::ModelSafeGroup AppDataTypeController::model_safe_group() { + return browser_sync::GROUP_UI; +} + +const char* AppDataTypeController::name() const { + // For logging only. + return "app"; +} + +DataTypeController::State AppDataTypeController::state() { + return state_; +} + void AppDataTypeController::OnUnrecoverableError( const tracked_objects::Location& from_here, const std::string& message) { diff --git a/chrome/browser/sync/glue/app_data_type_controller.h b/chrome/browser/sync/glue/app_data_type_controller.h index e8797f4..4bd2750 100644 --- a/chrome/browser/sync/glue/app_data_type_controller.h +++ b/chrome/browser/sync/glue/app_data_type_controller.h @@ -34,26 +34,15 @@ class AppDataTypeController : public DataTypeController { virtual void Stop(); - virtual bool enabled() { - return true; - } - - virtual syncable::ModelType type() { - return syncable::APPS; - } - - virtual browser_sync::ModelSafeGroup model_safe_group() { - return browser_sync::GROUP_UI; - } - - virtual const char* name() const { - // For logging only. - return "app"; - } - - virtual State state() { - return state_; - } + virtual bool enabled(); + + virtual syncable::ModelType type(); + + virtual browser_sync::ModelSafeGroup model_safe_group(); + + virtual const char* name() const; + + virtual State state(); // UnrecoverableErrorHandler interface. virtual void OnUnrecoverableError( diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.cc b/chrome/browser/sync/glue/autofill_data_type_controller.cc index 63c9e26..6a827c9 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller.cc @@ -148,6 +148,28 @@ void AutofillDataTypeController::Stop() { } } +bool AutofillDataTypeController::enabled() { + return true; +} + +syncable::ModelType AutofillDataTypeController::type() { + return syncable::AUTOFILL; +} + +browser_sync::ModelSafeGroup AutofillDataTypeController::model_safe_group() { + return browser_sync::GROUP_DB; +} + +const char* AutofillDataTypeController::name() const { + // For logging only. + return "autofill"; +} + +DataTypeController::State AutofillDataTypeController::state() { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + return state_; +} + void AutofillDataTypeController::StartImpl() { VLOG(1) << "Autofill data type controller StartImpl called."; DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.h b/chrome/browser/sync/glue/autofill_data_type_controller.h index d22fcfaf..c66dcfd 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.h +++ b/chrome/browser/sync/glue/autofill_data_type_controller.h @@ -40,27 +40,15 @@ class AutofillDataTypeController : public DataTypeController, virtual void Stop(); - virtual bool enabled() { - return true; - } + virtual bool enabled(); - virtual syncable::ModelType type() { - return syncable::AUTOFILL; - } + virtual syncable::ModelType type(); - virtual browser_sync::ModelSafeGroup model_safe_group() { - return browser_sync::GROUP_DB; - } + virtual browser_sync::ModelSafeGroup model_safe_group(); - virtual const char* name() const { - // For logging only. - return "autofill"; - } + virtual const char* name() const; - virtual State state() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - return state_; - } + virtual State state(); // UnrecoverableHandler implementation virtual void OnUnrecoverableError(const tracked_objects::Location& from_here, diff --git a/chrome/browser/sync/glue/autofill_profile_model_associator.cc b/chrome/browser/sync/glue/autofill_profile_model_associator.cc index 727c401..91027e3 100644 --- a/chrome/browser/sync/glue/autofill_profile_model_associator.cc +++ b/chrome/browser/sync/glue/autofill_profile_model_associator.cc @@ -32,6 +32,8 @@ AutofillProfileModelAssociator::~AutofillProfileModelAssociator() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); } +AutofillProfileModelAssociator::AutofillProfileModelAssociator() {} + bool AutofillProfileModelAssociator::TraverseAndAssociateChromeAutoFillProfiles( sync_api::WriteTransaction* write_trans, const sync_api::ReadNode& autofill_root, @@ -330,6 +332,23 @@ bool AutofillProfileModelAssociator::SaveChangesToWebData( return true; } +const std::string* AutofillProfileModelAssociator::GetChromeNodeFromSyncId( + int64 sync_id) { + return NULL; + } + +bool AutofillProfileModelAssociator::InitSyncNodeFromChromeId( + const std::string& node_id, + sync_api::BaseNode* sync_node) { + return false; +} + +bool AutofillProfileModelAssociator::GetSyncIdForTaggedNode( + const std::string& tag, + int64* sync_id) { + return false; +} + void AutofillProfileModelAssociator::Associate( const std::string* autofill, int64 sync_id) { diff --git a/chrome/browser/sync/glue/autofill_profile_model_associator.h b/chrome/browser/sync/glue/autofill_profile_model_associator.h index 048b5a4..ad8af5c 100644 --- a/chrome/browser/sync/glue/autofill_profile_model_associator.h +++ b/chrome/browser/sync/glue/autofill_profile_model_associator.h @@ -70,15 +70,10 @@ class AutofillProfileModelAssociator // See ModelAssociator interface. virtual void AbortAssociation(); - virtual const std::string* GetChromeNodeFromSyncId( - int64 sync_id) { - return NULL; - } + virtual const std::string* GetChromeNodeFromSyncId(int64 sync_id); virtual bool InitSyncNodeFromChromeId(const std::string& node_id, - sync_api::BaseNode* sync_node) { - return false; - } + sync_api::BaseNode* sync_node); // Returns the sync id for the given autofill name, or sync_api::kInvalidId // if the autofill name is not associated to any sync id. @@ -94,15 +89,13 @@ class AutofillProfileModelAssociator // given permanent tag was found and update // |sync_id| with that node's id. No current use. To Implement // only for completeness. - virtual bool GetSyncIdForTaggedNode(const std::string& tag, int64* sync_id) { - return false; - } + virtual bool GetSyncIdForTaggedNode(const std::string& tag, int64* sync_id); // Returns sync service instance. ProfileSyncService* sync_service() { return sync_service_; } protected: - AutofillProfileModelAssociator() {} + AutofillProfileModelAssociator(); bool TraverseAndAssociateChromeAutoFillProfiles( sync_api::WriteTransaction* write_trans, const sync_api::ReadNode& autofill_root, diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc index da749b8..80e02c3 100644 --- a/chrome/browser/sync/glue/bookmark_change_processor.cc +++ b/chrome/browser/sync/glue/bookmark_change_processor.cc @@ -128,6 +128,10 @@ void BookmarkChangeProcessor::RemoveSyncNodeHierarchy( DCHECK(index_stack.empty()); // Nothing should be left on the stack. } +void BookmarkChangeProcessor::Loaded(BookmarkModel* model) { + NOTREACHED(); +} + void BookmarkChangeProcessor::BookmarkModelBeingDeleted( BookmarkModel* model) { DCHECK(!running()) << "BookmarkModel deleted while ChangeProcessor running."; diff --git a/chrome/browser/sync/glue/bookmark_change_processor.h b/chrome/browser/sync/glue/bookmark_change_processor.h index 65a2632..461cbb0 100644 --- a/chrome/browser/sync/glue/bookmark_change_processor.h +++ b/chrome/browser/sync/glue/bookmark_change_processor.h @@ -31,7 +31,7 @@ class BookmarkChangeProcessor : public BookmarkModelObserver, // BookmarkModelObserver implementation. // BookmarkModel -> sync_api model change application. - virtual void Loaded(BookmarkModel* model) { NOTREACHED(); } + virtual void Loaded(BookmarkModel* model); virtual void BookmarkModelBeingDeleted(BookmarkModel* model); virtual void BookmarkNodeMoved(BookmarkModel* model, const BookmarkNode* old_parent, diff --git a/chrome/browser/sync/glue/change_processor.cc b/chrome/browser/sync/glue/change_processor.cc index 48a0876..f779070 100644 --- a/chrome/browser/sync/glue/change_processor.cc +++ b/chrome/browser/sync/glue/change_processor.cc @@ -27,4 +27,8 @@ void ChangeProcessor::Stop() { running_ = false; } +bool ChangeProcessor::IsRunning() const { + return running_; +} + } // namespace browser_sync diff --git a/chrome/browser/sync/glue/change_processor.h b/chrome/browser/sync/glue/change_processor.h index 4d6ec09..3e8a467 100644 --- a/chrome/browser/sync/glue/change_processor.h +++ b/chrome/browser/sync/glue/change_processor.h @@ -34,7 +34,7 @@ class ChangeProcessor { // |StartImpl|. void Start(Profile* profile, sync_api::UserShare* share_handle); void Stop(); - virtual bool IsRunning() const { return running_; } + virtual bool IsRunning() const; // Changes have been applied to the backend model and are ready to be // applied to the frontend model. See syncapi.h for detailed instructions on diff --git a/chrome/browser/sync/glue/theme_data_type_controller.cc b/chrome/browser/sync/glue/theme_data_type_controller.cc index be00f94..166710d 100644 --- a/chrome/browser/sync/glue/theme_data_type_controller.cc +++ b/chrome/browser/sync/glue/theme_data_type_controller.cc @@ -86,6 +86,28 @@ void ThemeDataTypeController::Stop() { state_ = NOT_RUNNING; } +bool ThemeDataTypeController::enabled() { + return true; + } + +syncable::ModelType ThemeDataTypeController::type() { + return syncable::THEMES; +} + +browser_sync::ModelSafeGroup ThemeDataTypeController::model_safe_group() { + return browser_sync::GROUP_UI; +} + +const char* ThemeDataTypeController::name() const { + // For logging only. + return "theme"; +} + +DataTypeController::State ThemeDataTypeController::state() { + return state_; +} + + void ThemeDataTypeController::OnUnrecoverableError( const tracked_objects::Location& from_here, const std::string& message) { diff --git a/chrome/browser/sync/glue/theme_data_type_controller.h b/chrome/browser/sync/glue/theme_data_type_controller.h index 2951a2d..09bc572 100644 --- a/chrome/browser/sync/glue/theme_data_type_controller.h +++ b/chrome/browser/sync/glue/theme_data_type_controller.h @@ -34,26 +34,15 @@ class ThemeDataTypeController : public DataTypeController { virtual void Stop(); - virtual bool enabled() { - return true; - } - - virtual syncable::ModelType type() { - return syncable::THEMES; - } - - virtual browser_sync::ModelSafeGroup model_safe_group() { - return browser_sync::GROUP_UI; - } - - virtual const char* name() const { - // For logging only. - return "theme"; - } - - virtual State state() { - return state_; - } + virtual bool enabled(); + + virtual syncable::ModelType type(); + + virtual browser_sync::ModelSafeGroup model_safe_group(); + + virtual const char* name() const; + + virtual State state(); // UnrecoverableErrorHandler interface. virtual void OnUnrecoverableError( diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.cc b/chrome/browser/sync/glue/typed_url_data_type_controller.cc index 62cd399..81e8d47 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.cc +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.cc @@ -115,6 +115,27 @@ void TypedUrlDataTypeController::Stop() { history_service_->ScheduleDBTask(new ControlTask(this, false), this); } +bool TypedUrlDataTypeController::enabled() { + return true; +} + +syncable::ModelType TypedUrlDataTypeController::type() { + return syncable::TYPED_URLS; +} + +browser_sync::ModelSafeGroup TypedUrlDataTypeController::model_safe_group() { + return browser_sync::GROUP_HISTORY; +} + +const char* TypedUrlDataTypeController::name() const { + // For logging only. + return "typed_url"; +} + +DataTypeController::State TypedUrlDataTypeController::state() { + return state_; +} + void TypedUrlDataTypeController::StartImpl(history::HistoryBackend* backend) { VLOG(1) << "TypedUrl data type controller StartImpl called."; // No additional services need to be started before we can proceed diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.h b/chrome/browser/sync/glue/typed_url_data_type_controller.h index d6cba9b..d3892a1 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.h +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.h @@ -50,26 +50,15 @@ class TypedUrlDataTypeController : public DataTypeController, virtual void Stop(); - virtual bool enabled() { - return true; - } + virtual bool enabled(); - virtual syncable::ModelType type() { - return syncable::TYPED_URLS; - } + virtual syncable::ModelType type(); - virtual browser_sync::ModelSafeGroup model_safe_group() { - return browser_sync::GROUP_HISTORY; - } + virtual browser_sync::ModelSafeGroup model_safe_group(); - virtual const char* name() const { - // For logging only. - return "typed_url"; - } + virtual const char* name() const; - virtual State state() { - return state_; - } + virtual State state(); // UnrecoverableHandler implementation virtual void OnUnrecoverableError(const tracked_objects::Location& from_here, diff --git a/chrome/browser/sync/glue/typed_url_model_associator.cc b/chrome/browser/sync/glue/typed_url_model_associator.cc index 36d312f..9c88fc0 100644 --- a/chrome/browser/sync/glue/typed_url_model_associator.cc +++ b/chrome/browser/sync/glue/typed_url_model_associator.cc @@ -232,6 +232,21 @@ bool TypedUrlModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) { return true; } +void TypedUrlModelAssociator::AbortAssociation() { + // TODO(zork): Implement this. +} + +const std::string* TypedUrlModelAssociator::GetChromeNodeFromSyncId( + int64 sync_id) { + return NULL; +} + +bool TypedUrlModelAssociator::InitSyncNodeFromChromeId( + const std::string& node_id, + sync_api::BaseNode* sync_node) { + return false; +} + int64 TypedUrlModelAssociator::GetSyncIdFromChromeId( const std::string& typed_url) { TypedUrlToSyncIdMap::const_iterator iter = id_map_.find(typed_url); diff --git a/chrome/browser/sync/glue/typed_url_model_associator.h b/chrome/browser/sync/glue/typed_url_model_associator.h index 72dd13e..6388de4 100644 --- a/chrome/browser/sync/glue/typed_url_model_associator.h +++ b/chrome/browser/sync/glue/typed_url_model_associator.h @@ -73,20 +73,14 @@ class TypedUrlModelAssociator // than the permanent tagged nodes. virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); - virtual void AbortAssociation() { - // TODO(zork): Implement this. - } + virtual void AbortAssociation(); // Not implemented. - virtual const std::string* GetChromeNodeFromSyncId(int64 sync_id) { - return NULL; - } + virtual const std::string* GetChromeNodeFromSyncId(int64 sync_id); // Not implemented. virtual bool InitSyncNodeFromChromeId(const std::string& node_id, - sync_api::BaseNode* sync_node) { - return false; - } + sync_api::BaseNode* sync_node); // Returns the sync id for the given typed_url name, or sync_api::kInvalidId // if the typed_url name is not associated to any sync id. diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc index f59dae0..a6dd5ec 100644 --- a/chrome/browser/sync/sync_setup_flow.cc +++ b/chrome/browser/sync/sync_setup_flow.cc @@ -345,6 +345,10 @@ void SyncSetupFlow::GetDialogSize(gfx::Size* size) const { #endif } +std::string SyncSetupFlow::GetDialogArgs() const { + return dialog_start_args_; +} + // A callback to notify the delegate that the dialog closed. void SyncSetupFlow::OnDialogClosed(const std::string& json_retval) { DCHECK(json_retval.empty()); @@ -385,6 +389,18 @@ void SyncSetupFlow::OnDialogClosed(const std::string& json_retval) { delete this; } +std::wstring SyncSetupFlow::GetDialogTitle() const { + return l10n_util::GetString(IDS_SYNC_MY_BOOKMARKS_LABEL); +} + +bool SyncSetupFlow::IsDialogModal() const { + return false; +} + +bool SyncSetupFlow::ShouldShowDialogTitle() const { + return true; +} + // static void SyncSetupFlow::GetArgsForGaiaLogin(const ProfileSyncService* service, DictionaryValue* args) { @@ -596,6 +612,10 @@ void SyncSetupFlow::Focus() { #endif // defined(OS_MACOSX) } +GURL SyncSetupFlow::GetDialogContentURL() const { + return GURL("chrome://syncresources/setup"); +} + // static SyncSetupFlow* SyncSetupFlow::Run(ProfileSyncService* service, SyncSetupFlowContainer* container, diff --git a/chrome/browser/sync/sync_setup_flow.h b/chrome/browser/sync/sync_setup_flow.h index 7d64402..8bfc443 100644 --- a/chrome/browser/sync/sync_setup_flow.h +++ b/chrome/browser/sync/sync_setup_flow.h @@ -72,9 +72,7 @@ class SyncSetupFlow : public HtmlDialogUIDelegate { // HtmlDialogUIDelegate implementation. // Get the HTML file path for the content to load in the dialog. - virtual GURL GetDialogContentURL() const { - return GURL("chrome://syncresources/setup"); - } + virtual GURL GetDialogContentURL() const; // HtmlDialogUIDelegate implementation. virtual void GetDOMMessageHandlers( @@ -86,27 +84,21 @@ class SyncSetupFlow : public HtmlDialogUIDelegate { // HtmlDialogUIDelegate implementation. // Gets the JSON string input to use when opening the dialog. - virtual std::string GetDialogArgs() const { - return dialog_start_args_; - } + virtual std::string GetDialogArgs() const; // HtmlDialogUIDelegate implementation. // A callback to notify the delegate that the dialog closed. virtual void OnDialogClosed(const std::string& json_retval); // HtmlDialogUIDelegate implementation. - virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) { } + virtual void OnCloseContents(TabContents* source, bool* out_close_dialog) {} // HtmlDialogUIDelegate implementation. - virtual std::wstring GetDialogTitle() const { - return l10n_util::GetString(IDS_SYNC_MY_BOOKMARKS_LABEL); - } + virtual std::wstring GetDialogTitle() const; // HtmlDialogUIDelegate implementation. - virtual bool IsDialogModal() const { - return false; - } - virtual bool ShouldShowDialogTitle() const { return true; } + virtual bool IsDialogModal() const; + virtual bool ShouldShowDialogTitle() const; void OnUserSubmittedAuth(const std::string& username, const std::string& password, diff --git a/chrome/browser/tab_contents/background_contents.cc b/chrome/browser/tab_contents/background_contents.cc index 96ed7af..1904d38 100644 --- a/chrome/browser/tab_contents/background_contents.cc +++ b/chrome/browser/tab_contents/background_contents.cc @@ -147,6 +147,14 @@ gfx::NativeWindow BackgroundContents::GetMessageBoxRootWindow() { return NULL; } +TabContents* BackgroundContents::AsTabContents() { + return NULL; +} + +ExtensionHost* BackgroundContents::AsExtensionHost() { + return NULL; +} + void BackgroundContents::UpdateInspectorSetting(const std::string& key, const std::string& value) { Profile* profile = render_view_host_->process()->profile(); diff --git a/chrome/browser/tab_contents/background_contents.h b/chrome/browser/tab_contents/background_contents.h index 3e2f307..ad5780016 100644 --- a/chrome/browser/tab_contents/background_contents.h +++ b/chrome/browser/tab_contents/background_contents.h @@ -129,8 +129,8 @@ class BackgroundContents : public RenderViewHostDelegate, const std::wstring& prompt); virtual void SetSuppressMessageBoxes(bool suppress_message_boxes) {} virtual gfx::NativeWindow GetMessageBoxRootWindow(); - virtual TabContents* AsTabContents() { return NULL; } - virtual ExtensionHost* AsExtensionHost() { return NULL; } + virtual TabContents* AsTabContents(); + virtual ExtensionHost* AsExtensionHost(); virtual void UpdateInspectorSetting(const std::string& key, const std::string& value); diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index bc9920b..2219523 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -463,6 +463,10 @@ void InterstitialPage::Proceed() { } } +std::string InterstitialPage::GetHTMLContents() { + return std::string(); +} + void InterstitialPage::DontProceed() { DCHECK(action_taken_ != DONT_PROCEED_ACTION); @@ -529,6 +533,10 @@ void InterstitialPage::FocusThroughTabTraversal(bool reverse) { render_view_host_->SetInitialFocus(reverse); } +ViewType::Type InterstitialPage::GetRenderViewType() const { + return ViewType::INTERSTITIAL_PAGE; +} + void InterstitialPage::Disable() { enabled_ = false; } diff --git a/chrome/browser/tab_contents/interstitial_page.h b/chrome/browser/tab_contents/interstitial_page.h index 2faad77..3592a9d 100644 --- a/chrome/browser/tab_contents/interstitial_page.h +++ b/chrome/browser/tab_contents/interstitial_page.h @@ -70,7 +70,7 @@ class InterstitialPage : public NotificationObserver, static InterstitialPage* GetInterstitialPage(TabContents* tab_contents); // Sub-classes should return the HTML that should be displayed in the page. - virtual std::string GetHTMLContents() { return std::string(); } + virtual std::string GetHTMLContents(); // Reverts to the page showing before the interstitial. // Sub-classes should call this method when the user has chosen NOT to proceed @@ -101,9 +101,7 @@ class InterstitialPage : public NotificationObserver, // Called when tab traversing. void FocusThroughTabTraversal(bool reverse); - virtual ViewType::Type GetRenderViewType() const { - return ViewType::INTERSTITIAL_PAGE; - } + virtual ViewType::Type GetRenderViewType() const; virtual int GetBrowserWindowID() const; // See description above field. diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc index d4821bd..4d71d27 100644 --- a/chrome/browser/worker_host/worker_process_host.cc +++ b/chrome/browser/worker_host/worker_process_host.cc @@ -439,6 +439,10 @@ void WorkerProcessHost::SenderShutdown(IPC::Message::Sender* sender) { } } +bool WorkerProcessHost::CanShutdown() { + return instances_.empty(); +} + void WorkerProcessHost::UpdateTitle() { std::set<std::string> titles; for (Instances::iterator i = instances_.begin(); i != instances_.end(); ++i) { diff --git a/chrome/browser/worker_host/worker_process_host.h b/chrome/browser/worker_host/worker_process_host.h index f00e1d0..f8adca0d 100644 --- a/chrome/browser/worker_host/worker_process_host.h +++ b/chrome/browser/worker_host/worker_process_host.h @@ -185,7 +185,7 @@ class WorkerProcessHost : public BrowserChildProcessHost { int route_id, CallbackWithReturnValue<int>::Type* next_route_id); - virtual bool CanShutdown() { return instances_.empty(); } + virtual bool CanShutdown(); // Updates the title shown in the task manager. void UpdateTitle(); |