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

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

Issue 2449243002: Gtk3 ui: Add libgtk3ui as a separate build component (Closed)
Patch Set: Add theme_properties dep to //chrome/browser/ui Created 4 years, 1 month 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 <stddef.h> 5 #include <stddef.h>
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/nix/mime_util_xdg.h" 16 #include "base/nix/mime_util_xdg.h"
17 #include "base/nix/xdg_util.h" 17 #include "base/nix/xdg_util.h"
18 #include "base/process/launch.h" 18 #include "base/process/launch.h"
19 #include "base/strings/string_number_conversions.h" 19 #include "base/strings/string_number_conversions.h"
20 #include "base/strings/string_split.h" 20 #include "base/strings/string_split.h"
21 #include "base/strings/string_util.h" 21 #include "base/strings/string_util.h"
22 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
23 #include "base/threading/thread_restrictions.h" 23 #include "base/threading/thread_restrictions.h"
24 #include "chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h" 24 #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h"
25 #include "chrome/grit/generated_resources.h" 25 #include "chrome/grit/generated_resources.h"
26 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
27 #include "ui/aura/window_tree_host.h" 27 #include "ui/aura/window_tree_host.h"
28 #include "ui/base/l10n/l10n_util.h" 28 #include "ui/base/l10n/l10n_util.h"
29 #include "ui/strings/grit/ui_strings.h" 29 #include "ui/strings/grit/ui_strings.h"
30 30
31 // These conflict with base/tracked_objects.h, so need to come last. 31 // These conflict with base/tracked_objects.h, so need to come last.
32 #include <gdk/gdkx.h> 32 #include <gdk/gdkx.h>
33 #include <gtk/gtk.h> 33 #include <gtk/gtk.h>
34 34
35 using content::BrowserThread; 35 using content::BrowserThread;
36 36
37 namespace { 37 namespace {
38 38
39 std::string GetTitle(const std::string& title, int message_id) { 39 std::string GetTitle(const std::string& title, int message_id) {
40 return title.empty() ? l10n_util::GetStringUTF8(message_id) : title; 40 return title.empty() ? l10n_util::GetStringUTF8(message_id) : title;
41 } 41 }
42 42
43 const char kKdialogBinary[] = "kdialog"; 43 const char kKdialogBinary[] = "kdialog";
44 44
45 } // namespace 45 } // namespace
46 46
47 namespace libgtk2ui { 47 namespace libgtkui {
48 48
49 // Implementation of SelectFileDialog that shows a KDE common dialog for 49 // Implementation of SelectFileDialog that shows a KDE common dialog for
50 // choosing a file or folder. This acts as a modal dialog. 50 // choosing a file or folder. This acts as a modal dialog.
51 class SelectFileDialogImplKDE : public SelectFileDialogImpl { 51 class SelectFileDialogImplKDE : public SelectFileDialogImpl {
52 public: 52 public:
53 SelectFileDialogImplKDE(Listener* listener, 53 SelectFileDialogImplKDE(Listener* listener,
54 ui::SelectFilePolicy* policy, 54 ui::SelectFilePolicy* policy,
55 base::nix::DesktopEnvironment desktop); 55 base::nix::DesktopEnvironment desktop);
56 56
57 protected: 57 protected:
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 filenames_fp.push_back(path); 517 filenames_fp.push_back(path);
518 } 518 }
519 519
520 if (filenames_fp.empty()) { 520 if (filenames_fp.empty()) {
521 FileNotSelected(params); 521 FileNotSelected(params);
522 return; 522 return;
523 } 523 }
524 MultiFilesSelected(filenames_fp, params); 524 MultiFilesSelected(filenames_fp, params);
525 } 525 }
526 526
527 } // namespace libgtk2ui 527 } // namespace libgtkui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698