| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chrome_browser_main_gtk.h" | 5 #include "chrome/browser/chrome_browser_main_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 : ChromeBrowserMainPartsPosix(parameters) { | 79 : ChromeBrowserMainPartsPosix(parameters) { |
| 80 } | 80 } |
| 81 | 81 |
| 82 void ChromeBrowserMainPartsGtk::PreEarlyInitialization() { | 82 void ChromeBrowserMainPartsGtk::PreEarlyInitialization() { |
| 83 DetectRunningAsRoot(); | 83 DetectRunningAsRoot(); |
| 84 | 84 |
| 85 ChromeBrowserMainPartsPosix::PreEarlyInitialization(); | 85 ChromeBrowserMainPartsPosix::PreEarlyInitialization(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void ChromeBrowserMainPartsGtk::DetectRunningAsRoot() { | 88 void ChromeBrowserMainPartsGtk::DetectRunningAsRoot() { |
| 89 #if defined(USE_AURA) |
| 90 // TODO(saintlou): |
| 91 #else |
| 89 if (geteuid() == 0) { | 92 if (geteuid() == 0) { |
| 90 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 93 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 91 if (parsed_command_line().HasSwitch(switches::kUserDataDir)) | 94 if (parsed_command_line().HasSwitch(switches::kUserDataDir)) |
| 92 return; | 95 return; |
| 93 | 96 |
| 94 gfx::GtkInitFromCommandLine(command_line); | 97 gfx::GtkInitFromCommandLine(command_line); |
| 95 | 98 |
| 96 // Get just enough of our resource machinery up so we can extract the | 99 // Get just enough of our resource machinery up so we can extract the |
| 97 // locale appropriate string. Note that the GTK implementation ignores the | 100 // locale appropriate string. Note that the GTK implementation ignores the |
| 98 // passed in parameter and checks the LANG environment variables instead. | 101 // passed in parameter and checks the LANG environment variables instead. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 117 "%s", | 120 "%s", |
| 118 message.c_str()); | 121 message.c_str()); |
| 119 | 122 |
| 120 message = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME); | 123 message = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME); |
| 121 gtk_window_set_title(GTK_WINDOW(dialog), message.c_str()); | 124 gtk_window_set_title(GTK_WINDOW(dialog), message.c_str()); |
| 122 | 125 |
| 123 gtk_dialog_run(GTK_DIALOG(dialog)); | 126 gtk_dialog_run(GTK_DIALOG(dialog)); |
| 124 gtk_widget_destroy(dialog); | 127 gtk_widget_destroy(dialog); |
| 125 exit(EXIT_FAILURE); | 128 exit(EXIT_FAILURE); |
| 126 } | 129 } |
| 130 #endif |
| 127 } | 131 } |
| 128 | 132 |
| 129 namespace content { | 133 namespace content { |
| 130 | 134 |
| 131 void DidEndMainMessageLoop() { | 135 void DidEndMainMessageLoop() { |
| 132 } | 136 } |
| 133 | 137 |
| 134 } | 138 } |
| 135 | 139 |
| 136 void RecordBreakpadStatusUMA(MetricsService* metrics) { | 140 void RecordBreakpadStatusUMA(MetricsService* metrics) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 185 } |
| 182 | 186 |
| 183 void PrepareRestartOnCrashEnviroment(const CommandLine &parsed_command_line) { | 187 void PrepareRestartOnCrashEnviroment(const CommandLine &parsed_command_line) { |
| 184 } | 188 } |
| 185 | 189 |
| 186 void SetBrowserX11ErrorHandlers() { | 190 void SetBrowserX11ErrorHandlers() { |
| 187 // Set up error handlers to make sure profile gets written if X server | 191 // Set up error handlers to make sure profile gets written if X server |
| 188 // goes away. | 192 // goes away. |
| 189 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler); | 193 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler); |
| 190 } | 194 } |
| OLD | NEW |