[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / views / javascript_app_modal_event_blocker_x11.h
bloba875fcae4c5a5321cfe70f5fbbcadb6ac596cd46
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_EVENT_BLOCKER_X11_H_
6 #define CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_EVENT_BLOCKER_X11_H_
8 #include "ui/events/event_handler.h"
10 class BrowserView;
12 namespace aura {
13 class Window;
16 // JavascriptAppModalEventBlockerX11 blocks events to all browser windows except
17 // the browser window which hosts |app_modal_window| for the duration of its
18 // lifetime. JavascriptAppModalEventBlockerX11 should not outlive
19 // |app_modal_window|.
20 // TODO(pkotwicz): Merge this class into WindowModalityController.
21 class JavascriptAppModalEventBlockerX11 : public ui::EventHandler {
22 public:
23 explicit JavascriptAppModalEventBlockerX11(aura::Window* app_modal_window);
24 virtual ~JavascriptAppModalEventBlockerX11();
26 private:
27 // Returns true if the propagation of events to |target| should be stopped.
28 bool ShouldStopPropagationTo(ui::EventTarget* target);
30 // ui::EventHandler:
31 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
32 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
33 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
34 virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
36 // The app modal dialog.
37 aura::Window* modal_window_;
39 // The BrowserView which hosts the app modal dialog.
40 BrowserView* browser_view_with_modal_dialog_;
42 DISALLOW_COPY_AND_ASSIGN(JavascriptAppModalEventBlockerX11);
45 #endif // CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_EVENT_BLOCKER_X11_H_