OLD | NEW |
---|---|
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 "chrome/browser/ui/libgtk2ui/gtk2_util.h" | 5 #include "chrome/browser/ui/libgtk2ui/gtk2_util.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 } | 49 } |
50 | 50 |
51 } // namespace | 51 } // namespace |
52 | 52 |
53 namespace libgtk2ui { | 53 namespace libgtk2ui { |
54 | 54 |
55 void GtkInitFromCommandLine(const base::CommandLine& command_line) { | 55 void GtkInitFromCommandLine(const base::CommandLine& command_line) { |
56 CommonInitFromCommandLine(command_line, gtk_init); | 56 CommonInitFromCommandLine(command_line, gtk_init); |
57 } | 57 } |
58 | 58 |
59 // TODO(erg): This method was copied out of shell_integration_linux.cc. Because | 59 // TODO(erg): This method was copied out of shell_integration_linux.cc. Because |
Lei Zhang
2016/07/28 21:28:46
Any chance we can deal with this TODO here? I'm an
| |
60 // of how this library is structured as a stand alone .so, we can't call code | 60 // of how this library is structured as a stand alone .so, we can't call code |
61 // from browser and above. | 61 // from browser and above. |
62 std::string GetDesktopName(base::Environment* env) { | 62 std::string GetDesktopName(base::Environment* env) { |
63 #if defined(GOOGLE_CHROME_BUILD) | 63 #if defined(GOOGLE_CHROME_BUILD) |
64 return "google-chrome.desktop"; | 64 version_info::Channel product_channel(chrome::GetChannel()); |
65 switch (product_channel) { | |
66 case version_info::Channel::DEV: | |
67 return "google-chrome-unstable.desktop"; | |
68 case version_info::Channel::BETA: | |
69 return "google-chrome-beta.desktop"; | |
70 default: | |
71 return "google-chrome.desktop"; | |
72 } | |
65 #else // CHROMIUM_BUILD | 73 #else // CHROMIUM_BUILD |
66 // Allow $CHROME_DESKTOP to override the built-in value, so that development | 74 // Allow $CHROME_DESKTOP to override the built-in value, so that development |
67 // versions can set themselves as the default without interfering with | 75 // versions can set themselves as the default without interfering with |
68 // non-official, packaged versions using the built-in value. | 76 // non-official, packaged versions using the built-in value. |
69 std::string name; | 77 std::string name; |
70 if (env->GetVar("CHROME_DESKTOP", &name) && !name.empty()) | 78 if (env->GetVar("CHROME_DESKTOP", &name) && !name.empty()) |
71 return name; | 79 return name; |
72 return "chromium-browser.desktop"; | 80 return "chromium-browser.desktop"; |
73 #endif | 81 #endif |
74 } | 82 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 aura::Window* GetAuraTransientParent(GtkWidget* dialog) { | 143 aura::Window* GetAuraTransientParent(GtkWidget* dialog) { |
136 return reinterpret_cast<aura::Window*>( | 144 return reinterpret_cast<aura::Window*>( |
137 g_object_get_data(G_OBJECT(dialog), kAuraTransientParent)); | 145 g_object_get_data(G_OBJECT(dialog), kAuraTransientParent)); |
138 } | 146 } |
139 | 147 |
140 void ClearAuraTransientParent(GtkWidget* dialog) { | 148 void ClearAuraTransientParent(GtkWidget* dialog) { |
141 g_object_set_data(G_OBJECT(dialog), kAuraTransientParent, NULL); | 149 g_object_set_data(G_OBJECT(dialog), kAuraTransientParent, NULL); |
142 } | 150 } |
143 | 151 |
144 } // namespace libgtk2ui | 152 } // namespace libgtk2ui |
OLD | NEW |