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_parts_gtk.h" | 5 #include "chrome/browser/chrome_browser_parts_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
11 #include "grit/chromium_strings.h" | 11 #include "grit/chromium_strings.h" |
12 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/gfx/gtk_util.h" | 15 #include "ui/gfx/gtk_util.h" |
16 | 16 |
17 ChromeBrowserPartsGtk::ChromeBrowserPartsGtk() | 17 ChromeBrowserPartsGtk::ChromeBrowserPartsGtk() |
18 : content::BrowserMainParts() { | 18 : ChromeBrowserParts() { |
19 } | 19 } |
20 | 20 |
21 void ChromeBrowserPartsGtk::PreEarlyInitialization() { | 21 void ChromeBrowserPartsGtk::PreEarlyInitialization() { |
22 DetectRunningAsRoot(); | 22 DetectRunningAsRoot(); |
23 } | 23 } |
24 | 24 |
25 void ChromeBrowserPartsGtk::PostEarlyInitialization() { | |
26 } | |
27 | |
28 void ChromeBrowserPartsGtk::ToolkitInitialized() { | |
29 } | |
30 | |
31 void ChromeBrowserPartsGtk::PreMainMessageLoopStart() { | |
32 } | |
33 | |
34 void ChromeBrowserPartsGtk::PostMainMessageLoopStart() { | |
35 } | |
36 | |
37 void ChromeBrowserPartsGtk::PreMainMessageLoopRun() { | |
38 } | |
39 | |
40 bool ChromeBrowserPartsGtk::MainMessageLoopRun(int* result_code) { | |
41 return false; | |
42 } | |
43 | |
44 void ChromeBrowserPartsGtk::PostMainMessageLoopRun() { | |
45 } | |
46 | 25 |
47 void ChromeBrowserPartsGtk::DetectRunningAsRoot() { | 26 void ChromeBrowserPartsGtk::DetectRunningAsRoot() { |
48 if (geteuid() == 0) { | 27 if (geteuid() == 0) { |
49 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 28 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
50 if (command_line.HasSwitch(switches::kUserDataDir)) | 29 if (command_line.HasSwitch(switches::kUserDataDir)) |
51 return; | 30 return; |
52 | 31 |
53 gfx::GtkInitFromCommandLine(command_line); | 32 gfx::GtkInitFromCommandLine(command_line); |
54 | 33 |
55 // Get just enough of our resource machinery up so we can extract the | 34 // Get just enough of our resource machinery up so we can extract the |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 static_cast<GtkDialogFlags>(0), | 71 static_cast<GtkDialogFlags>(0), |
93 GTK_MESSAGE_ERROR, | 72 GTK_MESSAGE_ERROR, |
94 GTK_BUTTONS_CLOSE, | 73 GTK_BUTTONS_CLOSE, |
95 "%s", | 74 "%s", |
96 message); | 75 message); |
97 | 76 |
98 gtk_window_set_title(GTK_WINDOW(dialog), message); | 77 gtk_window_set_title(GTK_WINDOW(dialog), message); |
99 gtk_dialog_run(GTK_DIALOG(dialog)); | 78 gtk_dialog_run(GTK_DIALOG(dialog)); |
100 gtk_widget_destroy(dialog); | 79 gtk_widget_destroy(dialog); |
101 } | 80 } |
OLD | NEW |