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

Side by Side Diff: chrome/browser/chrome_browser_main_extra_parts_gtk.cc

Issue 10270023: Add new ResourceBundle::Delegate interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/chrome_browser_main_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/chrome_browser_main_extra_parts_gtk.h" 5 #include "chrome/browser/chrome_browser_main_extra_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"
(...skipping 16 matching lines...) Expand all
27 if (geteuid() == 0) { 27 if (geteuid() == 0) {
28 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 28 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
29 if (command_line.HasSwitch(switches::kUserDataDir)) 29 if (command_line.HasSwitch(switches::kUserDataDir))
30 return; 30 return;
31 31
32 gfx::GtkInitFromCommandLine(command_line); 32 gfx::GtkInitFromCommandLine(command_line);
33 33
34 // 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
35 // locale appropriate string. Note that the GTK implementation ignores the 35 // locale appropriate string. Note that the GTK implementation ignores the
36 // passed in parameter and checks the LANG environment variables instead. 36 // passed in parameter and checks the LANG environment variables instead.
37 ResourceBundle::InitSharedInstanceWithLocale(""); 37 ResourceBundle::InitSharedInstanceWithLocale(std::string(), NULL);
38 38
39 std::string message = l10n_util::GetStringFUTF8( 39 std::string message = l10n_util::GetStringFUTF8(
40 IDS_REFUSE_TO_RUN_AS_ROOT, 40 IDS_REFUSE_TO_RUN_AS_ROOT,
41 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 41 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
42 GtkWidget* dialog = gtk_message_dialog_new( 42 GtkWidget* dialog = gtk_message_dialog_new(
43 NULL, 43 NULL,
44 static_cast<GtkDialogFlags>(0), 44 static_cast<GtkDialogFlags>(0),
45 GTK_MESSAGE_ERROR, 45 GTK_MESSAGE_ERROR,
46 GTK_BUTTONS_CLOSE, 46 GTK_BUTTONS_CLOSE,
47 "%s", 47 "%s",
(...skipping 23 matching lines...) Expand all
71 static_cast<GtkDialogFlags>(0), 71 static_cast<GtkDialogFlags>(0),
72 GTK_MESSAGE_ERROR, 72 GTK_MESSAGE_ERROR,
73 GTK_BUTTONS_CLOSE, 73 GTK_BUTTONS_CLOSE,
74 "%s", 74 "%s",
75 message); 75 message);
76 76
77 gtk_window_set_title(GTK_WINDOW(dialog), message); 77 gtk_window_set_title(GTK_WINDOW(dialog), message);
78 gtk_dialog_run(GTK_DIALOG(dialog)); 78 gtk_dialog_run(GTK_DIALOG(dialog));
79 gtk_widget_destroy(dialog); 79 gtk_widget_destroy(dialog);
80 } 80 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/chrome_browser_main_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698