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 using content::BrowserThread; |
| 18 |
17 ChromeBrowserPartsGtk::ChromeBrowserPartsGtk() | 19 ChromeBrowserPartsGtk::ChromeBrowserPartsGtk() |
18 : content::BrowserMainParts() { | 20 : content::BrowserMainParts() { |
19 } | 21 } |
20 | 22 |
21 void ChromeBrowserPartsGtk::PreEarlyInitialization() { | 23 void ChromeBrowserPartsGtk::PreEarlyInitialization() { |
22 DetectRunningAsRoot(); | 24 DetectRunningAsRoot(); |
23 } | 25 } |
24 | 26 |
25 void ChromeBrowserPartsGtk::PostEarlyInitialization() { | 27 void ChromeBrowserPartsGtk::PostEarlyInitialization() { |
26 } | 28 } |
27 | 29 |
| 30 void ChromeBrowserPartsGtk::PreMainMessageLoopStart() { |
| 31 } |
| 32 |
28 void ChromeBrowserPartsGtk::ToolkitInitialized() { | 33 void ChromeBrowserPartsGtk::ToolkitInitialized() { |
29 } | 34 } |
30 | 35 |
31 void ChromeBrowserPartsGtk::PreMainMessageLoopStart() { | |
32 } | |
33 | |
34 void ChromeBrowserPartsGtk::PostMainMessageLoopStart() { | 36 void ChromeBrowserPartsGtk::PostMainMessageLoopStart() { |
35 } | 37 } |
36 | 38 |
37 void ChromeBrowserPartsGtk::PreMainMessageLoopRun() { | 39 content::IOThreadDelegate* ChromeBrowserPartsGtk::PreMainMessageLoopRun() { |
| 40 return NULL; |
| 41 } |
| 42 |
| 43 void ChromeBrowserPartsGtk::PreMainMessageLoopRunThreadsCreated() { |
38 } | 44 } |
39 | 45 |
40 bool ChromeBrowserPartsGtk::MainMessageLoopRun(int* result_code) { | 46 bool ChromeBrowserPartsGtk::MainMessageLoopRun(int* result_code) { |
41 return false; | 47 return false; |
42 } | 48 } |
43 | 49 |
44 void ChromeBrowserPartsGtk::PostMainMessageLoopRun() { | 50 void ChromeBrowserPartsGtk::PostMainMessageLoopRun() { |
45 } | 51 } |
46 | 52 |
| 53 void ChromeBrowserPartsGtk::PreStopThread(BrowserThread::ID) { |
| 54 } |
| 55 |
| 56 void ChromeBrowserPartsGtk::PostStopThread(BrowserThread::ID) { |
| 57 } |
| 58 |
| 59 void ChromeBrowserPartsGtk::FinalCleanup() { |
| 60 } |
| 61 |
47 void ChromeBrowserPartsGtk::DetectRunningAsRoot() { | 62 void ChromeBrowserPartsGtk::DetectRunningAsRoot() { |
48 if (geteuid() == 0) { | 63 if (geteuid() == 0) { |
49 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 64 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
50 if (command_line.HasSwitch(switches::kUserDataDir)) | 65 if (command_line.HasSwitch(switches::kUserDataDir)) |
51 return; | 66 return; |
52 | 67 |
53 gfx::GtkInitFromCommandLine(command_line); | 68 gfx::GtkInitFromCommandLine(command_line); |
54 | 69 |
55 // Get just enough of our resource machinery up so we can extract the | 70 // Get just enough of our resource machinery up so we can extract the |
56 // locale appropriate string. Note that the GTK implementation ignores the | 71 // locale appropriate string. Note that the GTK implementation ignores the |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 static_cast<GtkDialogFlags>(0), | 107 static_cast<GtkDialogFlags>(0), |
93 GTK_MESSAGE_ERROR, | 108 GTK_MESSAGE_ERROR, |
94 GTK_BUTTONS_CLOSE, | 109 GTK_BUTTONS_CLOSE, |
95 "%s", | 110 "%s", |
96 message); | 111 message); |
97 | 112 |
98 gtk_window_set_title(GTK_WINDOW(dialog), message); | 113 gtk_window_set_title(GTK_WINDOW(dialog), message); |
99 gtk_dialog_run(GTK_DIALOG(dialog)); | 114 gtk_dialog_run(GTK_DIALOG(dialog)); |
100 gtk_widget_destroy(dialog); | 115 gtk_widget_destroy(dialog); |
101 } | 116 } |
OLD | NEW |