[chromium-style] move methods out of headers
This commit is contained in:
parent
f1587da480
commit
27cee90e5e
10 changed files with 45 additions and 22 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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+
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue