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

Unified Diff: chrome/app/chrome_main_delegate.cc

Issue 12035043: Implementing app command to query EULA acceptance state for Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code complete: added app command install and app_host.exe wait/forward. Created 7 years, 11 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
Index: chrome/app/chrome_main_delegate.cc
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
index 03ff32e60da870bbab44e9b91ffa097d0aa3797c..6e3508d31c2f54c00d5c75c7ec1d5321ac7ed02a 100644
--- a/chrome/app/chrome_main_delegate.cc
+++ b/chrome/app/chrome_main_delegate.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/defaults.h"
#include "chrome/browser/diagnostics/diagnostics_main.h"
+#include "chrome/browser/first_run/first_run.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_paths.h"
@@ -125,6 +126,17 @@ bool HasDeprecatedArguments(const std::wstring& command_line) {
return (pos != std::wstring::npos);
}
+// Handles command line switches to extract information from Chrome, which
+// can be passed via |exit_code| or by stdout.
+bool HandleInfoQuery(const CommandLine& command_line, int* exit_code) {
+ if (command_line.HasSwitch(switches::kQueryEULAAcceptance)) {
+ *exit_code = first_run::IsEULAAccepted() ? 1 : 0;
+ return true;
+ }
+
+ return false;
+}
+
// Checks if the registry key exists in the given hive and expands any
// variables in the string.
bool LoadUserDataDirPolicyFromRegistry(HKEY hive,
@@ -423,6 +435,10 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) {
*exit_code = 1;
return true;
}
+
+ if (HandleInfoQuery(command_line, exit_code)) {
grt (UTC plus 2) 2013/01/23 19:02:29 nit: no braces
huangs 2013/01/24 00:08:08 Done.
+ return true;
+ }
#endif
if (!command_line.HasSwitch(switches::kProcessType) &&
« no previous file with comments | « no previous file | chrome/browser/extensions/app_host/app_host_main.cc » ('j') | chrome/browser/first_run/first_run.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698