summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/first_run/upgrade_util_win.cc19
-rw-r--r--win8/metro_driver/chrome_app_view_ash.cc3
2 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/first_run/upgrade_util_win.cc b/chrome/browser/first_run/upgrade_util_win.cc
index f9557ee..2334500 100644
--- a/chrome/browser/first_run/upgrade_util_win.cc
+++ b/chrome/browser/first_run/upgrade_util_win.cc
@@ -18,6 +18,7 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
+#include "base/prefs/pref_service.h"
#include "base/process/launch.h"
#include "base/process/process_handle.h"
#include "base/strings/string_number_conversions.h"
@@ -27,16 +28,19 @@
#include "base/win/registry.h"
#include "base/win/scoped_comptr.h"
#include "base/win/windows_version.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/first_run/upgrade_util_win.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/google_update_constants.h"
#include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/shell_util.h"
#include "chrome/installer/util/util_constants.h"
#include "google_update/google_update_idl.h"
+#include "ui/base/ui_base_switches.h"
namespace {
@@ -110,6 +114,21 @@ RelaunchMode RelaunchModeStringToEnum(const std::string& relaunch_mode) {
if (relaunch_mode == kRelaunchModeDesktop)
return RELAUNCH_MODE_DESKTOP;
+ // On Windows 7 if the current browser is in Chrome OS mode, then restart
+ // into Chrome OS mode.
+ if ((base::win::GetVersion() == base::win::VERSION_WIN7) &&
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kViewerConnect) &&
+ g_browser_process->local_state()->HasPrefPath(prefs::kRelaunchMode)) {
+ // TODO(ananta)
+ // On Windows 8, the delegate execute process looks up the previously
+ // launched mode from the registry and relaunches into that mode. We need
+ // something similar on Windows 7. For now, set the pref to ensure that
+ // we get relaunched into Chrome OS mode.
+ g_browser_process->local_state()->SetString(
+ prefs::kRelaunchMode, upgrade_util::kRelaunchModeMetro);
+ return RELAUNCH_MODE_METRO;
+ }
+
return RELAUNCH_MODE_DEFAULT;
}
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc
index 2f615d3..0d1ea8b 100644
--- a/win8/metro_driver/chrome_app_view_ash.cc
+++ b/win8/metro_driver/chrome_app_view_ash.cc
@@ -971,6 +971,9 @@ void ChromeAppViewAsh::OnMetroExit(MetroTerminateMethod method) {
if (ui_channel_)
ui_channel_->Close();
+ HWND core_window = core_window_hwnd();
+ ::PostMessage(core_window, WM_CLOSE, 0, 0);
+
globals.app_exit->Exit();
}
}