Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/ui/views/chrome_browser_main_extra_parts_views.h" | 5 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" | 7 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" |
| 8 #include "chrome/browser/ui/views/chrome_views_delegate.h" | 8 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
| 9 #include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h" | 9 #include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h" |
| 10 #include "components/constrained_window/constrained_window_views.h" | 10 #include "components/constrained_window/constrained_window_views.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 IMEDriver::Register(); | 69 IMEDriver::Register(); |
| 70 #endif | 70 #endif |
| 71 | 71 |
| 72 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 72 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 73 // On the Linux desktop, we want to prevent the user from logging in as root, | 73 // On the Linux desktop, we want to prevent the user from logging in as root, |
| 74 // so that we don't destroy the profile. Now that we have some minimal ui | 74 // so that we don't destroy the profile. Now that we have some minimal ui |
| 75 // initialized, check to see if we're running as root and bail if we are. | 75 // initialized, check to see if we're running as root and bail if we are. |
| 76 if (getuid() != 0) | 76 if (getuid() != 0) |
| 77 return; | 77 return; |
| 78 | 78 |
| 79 const base::CommandLine& command_line = | |
|
sky
2017/01/05 23:21:59
Can you update the description to indicate why we
Tom (Use chromium acct)
2017/01/06 00:18:38
Updated the CL description.
| |
| 80 *base::CommandLine::ForCurrentProcess(); | |
| 81 if (command_line.HasSwitch(switches::kUserDataDir)) | |
| 82 return; | |
| 83 | |
| 84 base::string16 title = l10n_util::GetStringFUTF16( | 79 base::string16 title = l10n_util::GetStringFUTF16( |
| 85 IDS_REFUSE_TO_RUN_AS_ROOT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 80 IDS_REFUSE_TO_RUN_AS_ROOT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 86 base::string16 message = l10n_util::GetStringFUTF16( | 81 base::string16 message = l10n_util::GetStringFUTF16( |
| 87 IDS_REFUSE_TO_RUN_AS_ROOT_2, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 82 IDS_REFUSE_TO_RUN_AS_ROOT_2, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 88 | 83 |
| 89 chrome::ShowWarningMessageBox(NULL, title, message); | 84 chrome::ShowWarningMessageBox(NULL, title, message); |
| 90 | 85 |
| 91 // Avoids gpu_process_transport_factory.cc(153)] Check failed: | 86 // Avoids gpu_process_transport_factory.cc(153)] Check failed: |
| 92 // per_compositor_data_.empty() when quit is chosen. | 87 // per_compositor_data_.empty() when quit is chosen. |
| 93 base::RunLoop().RunUntilIdle(); | 88 base::RunLoop().RunUntilIdle(); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 113 &server); | 108 &server); |
| 114 input_device_client_->Connect(std::move(server)); | 109 input_device_client_->Connect(std::move(server)); |
| 115 | 110 |
| 116 window_manager_connection_ = views::WindowManagerConnection::Create( | 111 window_manager_connection_ = views::WindowManagerConnection::Create( |
| 117 connection->GetConnector(), connection->GetIdentity(), | 112 connection->GetConnector(), connection->GetIdentity(), |
| 118 content::BrowserThread::GetTaskRunnerForThread( | 113 content::BrowserThread::GetTaskRunnerForThread( |
| 119 content::BrowserThread::IO)); | 114 content::BrowserThread::IO)); |
| 120 } | 115 } |
| 121 #endif // defined(USE_AURA) | 116 #endif // defined(USE_AURA) |
| 122 } | 117 } |
| OLD | NEW |