[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(); Show();
} }
bool NativeWindow::IsClosed() const {
return is_closed_;
}
void NativeWindow::SetSize(const gfx::Size& size, bool animate) { void NativeWindow::SetSize(const gfx::Size& size, bool animate) {
SetBounds(gfx::Rect(GetPosition(), size), animate); SetBounds(gfx::Rect(GetPosition(), size), animate);
} }

View file

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

View file

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

View file

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

View file

@ -18,6 +18,11 @@
namespace atom { 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, AutofillPopupView::AutofillPopupView(AutofillPopup* popup,
views::Widget* parent_widget) views::Widget* parent_widget)
: popup_(popup), : popup_(popup),
@ -128,6 +133,16 @@ void AutofillPopupView::OnSuggestionsChanged() {
DoUpdateBoundsAndRedrawPopup(); 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( void AutofillPopupView::OnSelectedRowChanged(
base::Optional<int> previous_row_selection, base::Optional<int> previous_row_selection,
base::Optional<int> current_row_selection) { base::Optional<int> current_row_selection) {

View file

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

View file

@ -58,6 +58,13 @@ BrowserClient::BrowserClient() : browser_main_parts_(nullptr) {
BrowserClient::~BrowserClient() {} BrowserClient::~BrowserClient() {}
void BrowserClient::WebNotificationAllowed(
int render_process_id,
const base::Callback<void(bool, bool)>& callback) {
callback.Run(false, true);
}
NotificationPresenter* BrowserClient::GetNotificationPresenter() { NotificationPresenter* BrowserClient::GetNotificationPresenter() {
if (!notification_presenter_) { if (!notification_presenter_) {
// Create a new presenter if on OS X, Linux, or Windows 7+ // 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. // Subclasses should override this to enable or disable WebNotification.
virtual void WebNotificationAllowed( virtual void WebNotificationAllowed(
int render_process_id, int render_process_id,
const base::Callback<void(bool, bool)>& callback) { const base::Callback<void(bool, bool)>& callback);
callback.Run(false, true);
}
// Subclasses that override this (e.g., to provide their own protocol // Subclasses that override this (e.g., to provide their own protocol
// handlers) should call this implementation after doing their own work. // handlers) should call this implementation after doing their own work.

View file

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

View file

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