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

Side by Side Diff: chrome/browser/lifetime/application_lifetime_win.cc

Issue 297713002: Fixes crash in RemoteWindowTreeHostWin::HandleActivateDesktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: follow old pattern Created 6 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 | « no previous file | chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h » ('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/lifetime/application_lifetime.h" 5 #include "chrome/browser/lifetime/application_lifetime.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/win/metro.h" 9 #include "base/win/metro.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/first_run/upgrade_util.h" 12 #include "chrome/browser/first_run/upgrade_util.h"
13 #include "chrome/browser/ui/browser_finder.h" 13 #include "chrome/browser/ui/browser_finder.h"
14 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
15 #include "ui/views/widget/widget.h" 15 #include "ui/views/widget/widget.h"
16 16
17 #if defined(USE_AURA) 17 #if defined(USE_AURA)
18 #include "base/environment.h" 18 #include "base/environment.h"
19 #include "base/files/file_path.h" 19 #include "base/files/file_path.h"
20 #include "base/path_service.h" 20 #include "base/path_service.h"
21 #include "chrome/browser/metro_utils/metro_chrome_win.h" 21 #include "chrome/browser/metro_utils/metro_chrome_win.h"
22 #include "chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h "
22 #include "chrome/browser/shell_integration.h" 23 #include "chrome/browser/shell_integration.h"
23 #include "chrome/common/chrome_constants.h" 24 #include "chrome/common/chrome_constants.h"
24 #include "chrome/installer/util/util_constants.h" 25 #include "chrome/installer/util/util_constants.h"
25 #include "content/public/browser/web_contents.h" 26 #include "content/public/browser/web_contents.h"
26 #include "ui/aura/remote_window_tree_host_win.h"
27 #endif 27 #endif
28 28
29 namespace chrome { 29 namespace chrome {
30 30
31 #if !defined(USE_AURA) 31 #if !defined(USE_AURA)
32 void HandleAppExitingForPlatform() { 32 void HandleAppExitingForPlatform() {
33 views::Widget::CloseAllSecondaryWidgets(); 33 views::Widget::CloseAllSecondaryWidgets();
34 } 34 }
35 #endif 35 #endif
36 36
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // build tree however (where CHROME_VERSION is not set in the environment) 81 // build tree however (where CHROME_VERSION is not set in the environment)
82 // look for it in Chrome's directory. 82 // look for it in Chrome's directory.
83 if (!version_str.empty()) 83 if (!version_str.empty())
84 path = path.AppendASCII(version_str); 84 path = path.AppendASCII(version_str);
85 85
86 path = path.Append(installer::kDelegateExecuteExe); 86 path = path.Append(installer::kDelegateExecuteExe);
87 87
88 // Actually launching the process needs to happen in the metro viewer, 88 // Actually launching the process needs to happen in the metro viewer,
89 // otherwise it won't automatically transition to desktop. So we have 89 // otherwise it won't automatically transition to desktop. So we have
90 // to send an IPC to the viewer to do the ShellExecute. 90 // to send an IPC to the viewer to do the ShellExecute.
91 aura::HandleActivateDesktop(path, ash_execution_status == ASH_TERMINATE); 91 HandleActivateDesktop(path, ash_execution_status == ASH_TERMINATE);
92 } 92 }
93 #endif 93 #endif
94 94
95 void AttemptRestartToDesktopMode() { 95 void AttemptRestartToDesktopMode() {
96 PrefService* prefs = g_browser_process->local_state(); 96 PrefService* prefs = g_browser_process->local_state();
97 prefs->SetString(prefs::kRelaunchMode, 97 prefs->SetString(prefs::kRelaunchMode,
98 upgrade_util::kRelaunchModeDesktop); 98 upgrade_util::kRelaunchModeDesktop);
99 99
100 AttemptRestart(); 100 AttemptRestart();
101 } 101 }
102 102
103 void AttemptRestartToMetroMode() { 103 void AttemptRestartToMetroMode() {
104 PrefService* prefs = g_browser_process->local_state(); 104 PrefService* prefs = g_browser_process->local_state();
105 prefs->SetString(prefs::kRelaunchMode, 105 prefs->SetString(prefs::kRelaunchMode,
106 upgrade_util::kRelaunchModeMetro); 106 upgrade_util::kRelaunchModeMetro);
107 AttemptRestart(); 107 AttemptRestart();
108 } 108 }
109 109
110 } // namespace chrome 110 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698