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

Side by Side Diff: chrome/browser/ui/gtk/web_contents_modal_dialog_manager_gtk.cc

Issue 14969012: components: Create web_modal component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-before-land Created 7 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 using web_modal::NativeWebContentsModalDialogManagerDelegate;
14
12 namespace { 15 namespace {
13 16
14 // Web contents modal dialog manager implementation for the GTK port. Unlike the 17 // Web contents modal dialog manager implementation for the GTK port. Unlike the
15 // Win32 system, ConstrainedWindowGtk doesn't draw draggable fake windows and 18 // Win32 system, ConstrainedWindowGtk doesn't draw draggable fake windows and
16 // instead just centers the dialog. It is thus an order of magnitude simpler. 19 // instead just centers the dialog. It is thus an order of magnitude simpler.
17 class NativeWebContentsModalDialogManagerGtk 20 class NativeWebContentsModalDialogManagerGtk
18 : public NativeWebContentsModalDialogManager { 21 : public web_modal::NativeWebContentsModalDialogManager {
19 public: 22 public:
20 NativeWebContentsModalDialogManagerGtk( 23 NativeWebContentsModalDialogManagerGtk(
21 NativeWebContentsModalDialogManagerDelegate* native_delegate) 24 NativeWebContentsModalDialogManagerDelegate* native_delegate)
22 : native_delegate_(native_delegate), 25 : native_delegate_(native_delegate),
23 shown_widget_(NULL) { 26 shown_widget_(NULL) {
24 } 27 }
25 28
26 virtual ~NativeWebContentsModalDialogManagerGtk() { 29 virtual ~NativeWebContentsModalDialogManagerGtk() {
27 } 30 }
28 31
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 shown_widget_ = NULL; 138 shown_widget_ = NULL;
136 } 139 }
137 140
138 native_delegate_->WillClose(sender); 141 native_delegate_->WillClose(sender);
139 142
140 g_object_unref(sender); 143 g_object_unref(sender);
141 } 144 }
142 145
143 } // namespace 146 } // namespace
144 147
148 namespace web_modal {
149
145 NativeWebContentsModalDialogManager* 150 NativeWebContentsModalDialogManager*
146 WebContentsModalDialogManager::CreateNativeManager( 151 WebContentsModalDialogManager::CreateNativeManager(
147 NativeWebContentsModalDialogManagerDelegate* native_delegate) { 152 NativeWebContentsModalDialogManagerDelegate* native_delegate) {
148 return new NativeWebContentsModalDialogManagerGtk(native_delegate); 153 return new NativeWebContentsModalDialogManagerGtk(native_delegate);
149 } 154 }
155
156 } // namespace web_modal
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.cc ('k') | chrome/browser/ui/native_web_contents_modal_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698