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

Unified Diff: chrome/browser/chrome_browser_main_gtk.cc

Issue 8302016: Make GTK and Aura parts orthogonal to OS parts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_browser_main_gtk.h ('k') | chrome/browser/chrome_browser_main_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_gtk.cc
diff --git a/chrome/browser/chrome_browser_main_gtk.cc b/chrome/browser/chrome_browser_main_gtk.cc
deleted file mode 100644
index abf3f7abcb1f602c7baa55b02d53a1eea006680e..0000000000000000000000000000000000000000
--- a/chrome/browser/chrome_browser_main_gtk.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chrome_browser_main_gtk.h"
-
-#include <gtk/gtk.h>
-
-#include "base/command_line.h"
-#include "chrome/common/chrome_switches.h"
-#include "grit/chromium_strings.h"
-#include "grit/generated_resources.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "ui/gfx/gtk_util.h"
-
-ChromeBrowserMainPartsGtk::ChromeBrowserMainPartsGtk(
- const MainFunctionParams& parameters)
- : ChromeBrowserMainPartsPosix(parameters) {
-}
-
-void ChromeBrowserMainPartsGtk::PreEarlyInitialization() {
- DetectRunningAsRoot();
-
- ChromeBrowserMainPartsPosix::PreEarlyInitialization();
-}
-
-void ChromeBrowserMainPartsGtk::DetectRunningAsRoot() {
- if (geteuid() == 0) {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (parsed_command_line().HasSwitch(switches::kUserDataDir))
- return;
-
- gfx::GtkInitFromCommandLine(command_line);
-
- // Get just enough of our resource machinery up so we can extract the
- // locale appropriate string. Note that the GTK implementation ignores the
- // passed in parameter and checks the LANG environment variables instead.
- ResourceBundle::InitSharedInstance("");
-
- std::string message = l10n_util::GetStringFUTF8(
- IDS_REFUSE_TO_RUN_AS_ROOT,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
- GtkWidget* dialog = gtk_message_dialog_new(
- NULL,
- static_cast<GtkDialogFlags>(0),
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- "%s",
- message.c_str());
-
- LOG(ERROR) << "Startup refusing to run as root.";
- message = l10n_util::GetStringFUTF8(
- IDS_REFUSE_TO_RUN_AS_ROOT_2,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
- gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
- "%s",
- message.c_str());
-
- message = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME);
- gtk_window_set_title(GTK_WINDOW(dialog), message.c_str());
-
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
- exit(EXIT_FAILURE);
- }
-}
-
-void ShowMissingLocaleMessageBox() {
- GtkWidget* dialog = gtk_message_dialog_new(
- NULL,
- static_cast<GtkDialogFlags>(0),
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- "%s",
- chrome_browser::kMissingLocaleDataMessage);
-
- gtk_window_set_title(GTK_WINDOW(dialog),
- chrome_browser::kMissingLocaleDataTitle);
-
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
-}
« no previous file with comments | « chrome/browser/chrome_browser_main_gtk.h ('k') | chrome/browser/chrome_browser_main_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698