Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: ui/views/widget/widget.h

Issue 2604793002: Allow Widget to pass accelerator handling to its parent.
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/widget/widget.h
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h
index aa89478dd50604acafdad03b842dbdbdafbaaa52..01bf6e131a6d4b92b7d9952de16c2d323f3e690c 100644
--- a/ui/views/widget/widget.h
+++ b/ui/views/widget/widget.h
@@ -66,6 +66,7 @@ class NativeWidget;
class NonClientFrameView;
class TooltipManager;
class View;
+class WidgetAcceleratorHandlingDelegate;
class WidgetDelegate;
class WidgetObserver;
class WidgetRemovalsObserver;
@@ -289,6 +290,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// be sent to the widget.
bool wants_mouse_events_when_inactive = false;
+ bool pass_accelerator_to_parent = false;
+
// A map of properties applied to windows when running in mus.
std::map<std::string, std::vector<uint8_t>> mus_properties;
};
@@ -391,6 +394,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// no accelerator associated with a given id, which is a common condition.
virtual bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator) const;
+ bool CanHandleAccelerators() const;
+ void AddHandleAcceleratorsOverride();
+ void RemoveHandleAcceleratorsOverride();
+
// Forwarded from the RootView so that the widget can do any cleanup.
void ViewHierarchyChanged(const View::ViewHierarchyChangedDetails& details);
@@ -969,6 +976,10 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// disabled.
bool movement_disabled_;
+ std::unique_ptr<WidgetAcceleratorHandlingDelegate>
+ accelerator_handling_delegate_;
+ int handle_accelerators_override_count_ = 0;
+
ScopedObserver<ui::NativeTheme, ui::NativeThemeObserver> observer_manager_;
DISALLOW_COPY_AND_ASSIGN(Widget);

Powered by Google App Engine
This is Rietveld 408576698