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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/libgtk2ui/gconf_listener.h" 5 #include "chrome/browser/ui/libgtk2ui/gconf_listener.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <memory>
10
9 #include "base/bind.h" 11 #include "base/bind.h"
10 #include "base/callback.h" 12 #include "base/callback.h"
11 #include "base/environment.h" 13 #include "base/environment.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/nix/xdg_util.h" 14 #include "base/nix/xdg_util.h"
14 #include "base/strings/string_piece.h" 15 #include "base/strings/string_piece.h"
15 #include "base/strings/string_tokenizer.h" 16 #include "base/strings/string_tokenizer.h"
16 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" 17 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
17 #include "ui/base/x/x11_util.h" 18 #include "ui/base/x/x11_util.h"
18 #include "ui/views/window/frame_buttons.h" 19 #include "ui/views/window/frame_buttons.h"
19 20
20 namespace { 21 namespace {
21 22
22 // The GConf key we read for the button placement string. Even through the key 23 // The GConf key we read for the button placement string. Even through the key
(...skipping 14 matching lines...) Expand all
37 38
38 } // namespace 39 } // namespace
39 40
40 namespace libgtk2ui { 41 namespace libgtk2ui {
41 42
42 // Public interface: 43 // Public interface:
43 44
44 GConfListener::GConfListener(Gtk2UI* delegate) 45 GConfListener::GConfListener(Gtk2UI* delegate)
45 : delegate_(delegate), 46 : delegate_(delegate),
46 client_(NULL) { 47 client_(NULL) {
47 scoped_ptr<base::Environment> env(base::Environment::Create()); 48 std::unique_ptr<base::Environment> env(base::Environment::Create());
48 base::nix::DesktopEnvironment de = 49 base::nix::DesktopEnvironment de =
49 base::nix::GetDesktopEnvironment(env.get()); 50 base::nix::GetDesktopEnvironment(env.get());
50 if (de == base::nix::DESKTOP_ENVIRONMENT_GNOME || 51 if (de == base::nix::DESKTOP_ENVIRONMENT_GNOME ||
51 de == base::nix::DESKTOP_ENVIRONMENT_UNITY || 52 de == base::nix::DESKTOP_ENVIRONMENT_UNITY ||
52 ui::GuessWindowManager() == ui::WM_METACITY) { 53 ui::GuessWindowManager() == ui::WM_METACITY) {
53 client_ = gconf_client_get_default(); 54 client_ = gconf_client_get_default();
54 // If we fail to get a context, that's OK, since we'll just fallback on 55 // If we fail to get a context, that's OK, since we'll just fallback on
55 // not receiving gconf keys. 56 // not receiving gconf keys.
56 if (client_) { 57 if (client_) {
57 // Register that we're interested in the values of this directory. 58 // Register that we're interested in the values of this directory.
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // value, we want to default to no action if the user has explicitly 179 // value, we want to default to no action if the user has explicitly
179 // chose an action that we don't implement. 180 // chose an action that we don't implement.
180 action = views::LinuxUI::MIDDLE_CLICK_ACTION_NONE; 181 action = views::LinuxUI::MIDDLE_CLICK_ACTION_NONE;
181 } 182 }
182 } 183 }
183 184
184 delegate_->SetNonClientMiddleClickAction(action); 185 delegate_->SetNonClientMiddleClickAction(action);
185 } 186 }
186 187
187 } // namespace libgtk2ui 188 } // namespace libgtk2ui
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtk2ui/app_indicator_icon.cc ('k') | chrome/browser/ui/libgtk2ui/gtk2_status_icon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698