[chromium-style] move methods out of headers

This commit is contained in:
Jeremy Apthorp 2018-04-17 16:47:47 -07:00
parent f1587da480
commit 27cee90e5e
10 changed files with 45 additions and 22 deletions

View file

@ -155,6 +155,10 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
Show();
}
bool NativeWindow::IsClosed() const {
return is_closed_;
}
void NativeWindow::SetSize(const gfx::Size& size, bool animate) {
SetBounds(gfx::Rect(GetPosition(), size), animate);
}

View file

@ -63,7 +63,7 @@ class NativeWindow : public base::SupportsUserData {
virtual void Close() = 0;
virtual void CloseImmediately() = 0;
virtual bool IsClosed() const { return is_closed_; }
virtual bool IsClosed() const;
virtual void Focus(bool focus) = 0;
virtual bool IsFocused() = 0;
virtual void Show() = 0;

View file

@ -8,6 +8,12 @@
namespace atom {
bool AtomMenuModel::Delegate::GetAcceleratorForCommandId(int command_id,
ui::Accelerator* accelerator) const {
return GetAcceleratorForCommandIdWithParams(
command_id, false, accelerator);
}
AtomMenuModel::AtomMenuModel(Delegate* delegate)
: ui::SimpleMenuModel(delegate), delegate_(delegate) {}

View file

@ -26,10 +26,7 @@ class AtomMenuModel : public ui::SimpleMenuModel {
private:
// ui::SimpleMenuModel::Delegate:
bool GetAcceleratorForCommandId(int command_id,
ui::Accelerator* accelerator) const {
return GetAcceleratorForCommandIdWithParams(command_id, false,
accelerator);
}
ui::Accelerator* accelerator) const override;
};
class Observer {

View file

@ -18,6 +18,11 @@
namespace atom {
void AutofillPopupChildView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->role = ui::AX_ROLE_MENU_ITEM;
node_data->SetName(suggestion_);
}
AutofillPopupView::AutofillPopupView(AutofillPopup* popup,
views::Widget* parent_widget)
: popup_(popup),
@ -128,6 +133,16 @@ void AutofillPopupView::OnSuggestionsChanged() {
DoUpdateBoundsAndRedrawPopup();
}
int AutofillPopupView::GetDragOperationsForView(
views::View*, const gfx::Point&) {
return ui::DragDropTypes::DRAG_NONE;
}
bool AutofillPopupView::CanStartDragForView(
views::View*, const gfx::Point&, const gfx::Point&) {
return false;
}
void AutofillPopupView::OnSelectedRowChanged(
base::Optional<int> previous_row_selection,
base::Optional<int> current_row_selection) {

View file

@ -42,10 +42,7 @@ class AutofillPopupChildView : public views::View {
~AutofillPopupChildView() override {}
// views::Views implementation
void GetAccessibleNodeData(ui::AXNodeData* node_data) override {
node_data->role = ui::AX_ROLE_MENU_ITEM;
node_data->SetName(suggestion_);
}
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
base::string16 suggestion_;
@ -70,15 +67,11 @@ class AutofillPopupView : public views::WidgetDelegateView,
void WriteDragDataForView(views::View*,
const gfx::Point&,
ui::OSExchangeData*) override {}
int GetDragOperationsForView(views::View*, const gfx::Point&) override {
return ui::DragDropTypes::DRAG_NONE;
}
ui::OSExchangeData*) override;
int GetDragOperationsForView(views::View*, const gfx::Point&) override;
bool CanStartDragForView(views::View*,
const gfx::Point&,
const gfx::Point&) override {
return false;
}
const gfx::Point&) override;
private:
friend class AutofillPopup;

View file

@ -58,6 +58,13 @@ BrowserClient::BrowserClient() : browser_main_parts_(nullptr) {
BrowserClient::~BrowserClient() {}
void BrowserClient::WebNotificationAllowed(
int render_process_id,
const base::Callback<void(bool, bool)>& callback) {
callback.Run(false, true);
}
NotificationPresenter* BrowserClient::GetNotificationPresenter() {
if (!notification_presenter_) {
// Create a new presenter if on OS X, Linux, or Windows 7+

View file

@ -32,9 +32,7 @@ class BrowserClient : public content::ContentBrowserClient {
// Subclasses should override this to enable or disable WebNotification.
virtual void WebNotificationAllowed(
int render_process_id,
const base::Callback<void(bool, bool)>& callback) {
callback.Run(false, true);
}
const base::Callback<void(bool, bool)>& callback);
// Subclasses that override this (e.g., to provide their own protocol
// handlers) should call this implementation after doing their own work.

View file

@ -60,6 +60,11 @@ std::string URLRequestContextGetter::Delegate::GetUserAgent() {
return base::EmptyString();
}
std::unique_ptr<net::NetworkDelegate>
URLRequestContextGetter::Delegate::CreateNetworkDelegate() {
return nullptr;
}
std::unique_ptr<net::URLRequestJobFactory>
URLRequestContextGetter::Delegate::CreateURLRequestJobFactory(
content::ProtocolHandlerMap* protocol_handlers) {

View file

@ -48,9 +48,7 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
Delegate() {}
virtual ~Delegate() {}
virtual std::unique_ptr<net::NetworkDelegate> CreateNetworkDelegate() {
return nullptr;
}
virtual std::unique_ptr<net::NetworkDelegate> CreateNetworkDelegate();
virtual std::string GetUserAgent();
virtual std::unique_ptr<net::URLRequestJobFactory>
CreateURLRequestJobFactory(content::ProtocolHandlerMap* protocol_handlers);