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

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

Issue 1363093004: Add BrowserSelectFileDialogTest.OpenCloseFileDialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enable the test and skip libglib-2.0 from LSan report Created 5 years, 2 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 53
54 protected: 54 protected:
55 ~SelectFileDialogImplKDE() override; 55 ~SelectFileDialogImplKDE() override;
56 void CloseImpl() 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,
63 const base::string16& title, 64 const base::string16& title,
64 const base::FilePath& default_path, 65 const base::FilePath& default_path,
65 const FileTypeInfo* file_types, 66 const FileTypeInfo* file_types,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 desktop_ == base::nix::DESKTOP_ENVIRONMENT_KDE5); 200 desktop_ == base::nix::DESKTOP_ENVIRONMENT_KDE5);
200 } 201 }
201 202
203 void SelectFileDialogImplKDE::CloseImpl() {
204 NOTIMPLEMENTED();
205 }
206
202 SelectFileDialogImplKDE::~SelectFileDialogImplKDE() { 207 SelectFileDialogImplKDE::~SelectFileDialogImplKDE() {
203 } 208 }
204 209
205 bool SelectFileDialogImplKDE::IsRunning(gfx::NativeWindow parent_window) const { 210 bool SelectFileDialogImplKDE::IsRunning(gfx::NativeWindow parent_window) const {
206 DCHECK_CURRENTLY_ON(BrowserThread::UI); 211 DCHECK_CURRENTLY_ON(BrowserThread::UI);
207 if (parent_window && parent_window->GetHost()) { 212 if (parent_window && parent_window->GetHost()) {
208 XID xid = parent_window->GetHost()->GetAcceleratedWidget(); 213 XID xid = parent_window->GetHost()->GetAcceleratedWidget();
209 return parents_.find(xid) != parents_.end(); 214 return parents_.find(xid) != parents_.end();
210 } 215 }
211 216
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 } 513 }
509 514
510 if (filenames_fp.empty()) { 515 if (filenames_fp.empty()) {
511 FileNotSelected(params); 516 FileNotSelected(params);
512 return; 517 return;
513 } 518 }
514 MultiFilesSelected(filenames_fp, params); 519 MultiFilesSelected(filenames_fp, params);
515 } 520 }
516 521
517 } // namespace libgtk2ui 522 } // namespace libgtk2ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698