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

Side by Side Diff: chrome/browser/ui/libgtk2ui/select_file_dialog_impl_kde.cc

Issue 1233913009: Make File-Picker modal on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: close the file-picker when the test is done. Created 5 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <set> 5 #include <set>
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 namespace libgtk2ui { 44 namespace libgtk2ui {
45 45
46 // Implementation of SelectFileDialog that shows a KDE common dialog for 46 // Implementation of SelectFileDialog that shows a KDE common dialog for
47 // choosing a file or folder. This acts as a modal dialog. 47 // choosing a file or folder. This acts as a modal dialog.
48 class SelectFileDialogImplKDE : public SelectFileDialogImpl { 48 class SelectFileDialogImplKDE : public SelectFileDialogImpl {
49 public: 49 public:
50 SelectFileDialogImplKDE(Listener* listener, 50 SelectFileDialogImplKDE(Listener* listener,
51 ui::SelectFilePolicy* policy, 51 ui::SelectFilePolicy* policy,
52 base::nix::DesktopEnvironment desktop); 52 base::nix::DesktopEnvironment desktop);
53 void CloseImpl() override;
53 54
54 protected: 55 protected:
55 ~SelectFileDialogImplKDE() override; 56 ~SelectFileDialogImplKDE() override;
56 57
57 // BaseShellDialog implementation: 58 // BaseShellDialog implementation:
58 bool IsRunning(gfx::NativeWindow parent_window) const override; 59 bool IsRunning(gfx::NativeWindow parent_window) const override;
59 60
60 // SelectFileDialog implementation. 61 // SelectFileDialog implementation.
61 // |params| is user data we pass back via the Listener interface. 62 // |params| is user data we pass back via the Listener interface.
62 void SelectFileImpl(Type type, 63 void SelectFileImpl(Type type,
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 SelectFileDialogImplKDE::SelectFileDialogImplKDE( 192 SelectFileDialogImplKDE::SelectFileDialogImplKDE(
192 Listener* listener, 193 Listener* listener,
193 ui::SelectFilePolicy* policy, 194 ui::SelectFilePolicy* policy,
194 base::nix::DesktopEnvironment desktop) 195 base::nix::DesktopEnvironment desktop)
195 : SelectFileDialogImpl(listener, policy), 196 : SelectFileDialogImpl(listener, policy),
196 desktop_(desktop) { 197 desktop_(desktop) {
197 DCHECK(desktop_ == base::nix::DESKTOP_ENVIRONMENT_KDE3 || 198 DCHECK(desktop_ == base::nix::DESKTOP_ENVIRONMENT_KDE3 ||
198 desktop_ == base::nix::DESKTOP_ENVIRONMENT_KDE4); 199 desktop_ == base::nix::DESKTOP_ENVIRONMENT_KDE4);
199 } 200 }
200 201
202 void SelectFileDialogImplKDE::CloseImpl() {
203 }
204
201 SelectFileDialogImplKDE::~SelectFileDialogImplKDE() { 205 SelectFileDialogImplKDE::~SelectFileDialogImplKDE() {
202 } 206 }
203 207
204 bool SelectFileDialogImplKDE::IsRunning(gfx::NativeWindow parent_window) const { 208 bool SelectFileDialogImplKDE::IsRunning(gfx::NativeWindow parent_window) const {
205 DCHECK_CURRENTLY_ON(BrowserThread::UI); 209 DCHECK_CURRENTLY_ON(BrowserThread::UI);
206 if (parent_window && parent_window->GetHost()) { 210 if (parent_window && parent_window->GetHost()) {
207 XID xid = parent_window->GetHost()->GetAcceleratedWidget(); 211 XID xid = parent_window->GetHost()->GetAcceleratedWidget();
208 return parents_.find(xid) != parents_.end(); 212 return parents_.find(xid) != parents_.end();
209 } 213 }
210 214
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 511 }
508 512
509 if (filenames_fp.empty()) { 513 if (filenames_fp.empty()) {
510 FileNotSelected(params); 514 FileNotSelected(params);
511 return; 515 return;
512 } 516 }
513 MultiFilesSelected(filenames_fp, params); 517 MultiFilesSelected(filenames_fp, params);
514 } 518 }
515 519
516 } // namespace libgtk2ui 520 } // namespace libgtk2ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698