OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "athena/extensions/athena_constrained_window_views_client.h" | 5 #include "athena/extensions/athena_constrained_window_views_client.h" |
6 | 6 |
7 #include "athena/activity/public/activity.h" | 7 #include "athena/activity/public/activity.h" |
8 #include "athena/activity/public/activity_manager.h" | 8 #include "athena/activity/public/activity_manager.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "components/constrained_window/constrained_window_views.h" | 11 #include "components/constrained_window/constrained_window_views.h" |
12 #include "components/constrained_window/constrained_window_views_client.h" | 12 #include "components/constrained_window/constrained_window_views_client.h" |
13 #include "components/web_modal/web_contents_modal_dialog_host.h" | 13 #include "components/web_modal/web_contents_modal_dialog_host.h" |
14 #include "extensions/browser/guest_view/guest_view_base.h" | 14 #include "extensions/browser/guest_view/guest_view_base.h" |
15 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
16 #include "ui/aura/window_observer.h" | 16 #include "ui/aura/window_observer.h" |
17 #include "ui/aura/window_property.h" | 17 #include "ui/aura/window_property.h" |
18 | 18 |
| 19 DECLARE_WINDOW_PROPERTY_TYPE(web_modal::ModalDialogHost*); |
| 20 |
19 namespace athena { | 21 namespace athena { |
20 namespace { | 22 namespace { |
21 | 23 |
22 // Provides the host environment for web modal dialogs. See | 24 // Provides the host environment for web modal dialogs. See |
23 // web_modal::WebContentsModalDialogHost, and ModalDialogHost for more | 25 // web_modal::WebContentsModalDialogHost, and ModalDialogHost for more |
24 // details. | 26 // details. |
25 class ModalDialogHostImpl : public web_modal::WebContentsModalDialogHost, | 27 class ModalDialogHostImpl : public web_modal::WebContentsModalDialogHost, |
26 public aura::WindowObserver { | 28 public aura::WindowObserver { |
27 public: | 29 public: |
28 // Returns a modal dialog host for |window|. If it doesn't exist it creates | 30 // Returns a modal dialog host for |window|. If it doesn't exist it creates |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void InstallConstrainedWindowViewsClient() { | 135 void InstallConstrainedWindowViewsClient() { |
134 constrained_window::SetConstrainedWindowViewsClient( | 136 constrained_window::SetConstrainedWindowViewsClient( |
135 make_scoped_ptr(new AthenaConstrainedWindowViewsClient)); | 137 make_scoped_ptr(new AthenaConstrainedWindowViewsClient)); |
136 } | 138 } |
137 | 139 |
138 void UninstallConstrainedWindowViewsClient() { | 140 void UninstallConstrainedWindowViewsClient() { |
139 constrained_window::SetConstrainedWindowViewsClient(nullptr); | 141 constrained_window::SetConstrainedWindowViewsClient(nullptr); |
140 } | 142 } |
141 | 143 |
142 } // namespace athena | 144 } // namespace athena |
OLD | NEW |