| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/ui/gtk/gtk_util.h" | 5 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 6 #include "chrome/browser/ui/gtk/tab_contents/chrome_web_contents_view_delegate_g
tk.h" | 6 #include "chrome/browser/ui/gtk/tab_contents/chrome_web_contents_view_delegate_g
tk.h" |
| 7 #include "chrome/browser/ui/native_web_contents_modal_dialog_manager.h" | 7 #include "components/web_modal/native_web_contents_modal_dialog_manager.h" |
| 8 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" | 8 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "ui/base/gtk/focus_store_gtk.h" | 10 #include "ui/base/gtk/focus_store_gtk.h" |
| 11 | 11 |
| 12 using web_modal::NativeWebContentsModalDialog; |
| 13 |
| 12 namespace { | 14 namespace { |
| 13 | 15 |
| 14 // Web contents modal dialog manager implementation for the GTK port. Unlike the | 16 // Web contents modal dialog manager implementation for the GTK port. Unlike the |
| 15 // Win32 system, ConstrainedWindowGtk doesn't draw draggable fake windows and | 17 // Win32 system, ConstrainedWindowGtk doesn't draw draggable fake windows and |
| 16 // instead just centers the dialog. It is thus an order of magnitude simpler. | 18 // instead just centers the dialog. It is thus an order of magnitude simpler. |
| 17 class NativeWebContentsModalDialogManagerGtk | 19 class NativeWebContentsModalDialogManagerGtk |
| 18 : public NativeWebContentsModalDialogManager { | 20 : public web_modal::NativeWebContentsModalDialogManager { |
| 19 public: | 21 public: |
| 20 NativeWebContentsModalDialogManagerGtk( | 22 NativeWebContentsModalDialogManagerGtk( |
| 21 NativeWebContentsModalDialogManagerDelegate* native_delegate) | 23 NativeWebContentsModalDialogManagerDelegate* native_delegate) |
| 22 : native_delegate_(native_delegate), | 24 : native_delegate_(native_delegate), |
| 23 shown_widget_(NULL) { | 25 shown_widget_(NULL) { |
| 24 } | 26 } |
| 25 | 27 |
| 26 virtual ~NativeWebContentsModalDialogManagerGtk() { | 28 virtual ~NativeWebContentsModalDialogManagerGtk() { |
| 27 } | 29 } |
| 28 | 30 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 shown_widget_ = NULL; | 137 shown_widget_ = NULL; |
| 136 } | 138 } |
| 137 | 139 |
| 138 native_delegate_->WillClose(sender); | 140 native_delegate_->WillClose(sender); |
| 139 | 141 |
| 140 g_object_unref(sender); | 142 g_object_unref(sender); |
| 141 } | 143 } |
| 142 | 144 |
| 143 } // namespace | 145 } // namespace |
| 144 | 146 |
| 147 namespace web_modal { |
| 148 |
| 145 NativeWebContentsModalDialogManager* | 149 NativeWebContentsModalDialogManager* |
| 146 WebContentsModalDialogManager::CreateNativeManager( | 150 WebContentsModalDialogManager::CreateNativeManager( |
| 147 NativeWebContentsModalDialogManagerDelegate* native_delegate) { | 151 NativeWebContentsModalDialogManagerDelegate* native_delegate) { |
| 148 return new NativeWebContentsModalDialogManagerGtk(native_delegate); | 152 return new NativeWebContentsModalDialogManagerGtk(native_delegate); |
| 149 } | 153 } |
| 154 |
| 155 } // namespace web_modal |
| OLD | NEW |