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

Side by Side Diff: chrome/browser/browser_process_platform_part_aurawin.cc

Issue 1581473002: Remove base/win/metro.{cc|h} and some associated code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/browser_process_platform_part_aurawin.h" 5 #include "chrome/browser/browser_process_platform_part_aurawin.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/process/kill.h" 10 #include "base/process/kill.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 !metro_viewer_process_host_.get())); 49 !metro_viewer_process_host_.get()));
50 if (!connect) 50 if (!connect)
51 return; 51 return;
52 // Create a host to connect to the Metro viewer process over IPC. 52 // Create a host to connect to the Metro viewer process over IPC.
53 metro_viewer_process_host_.reset(new ChromeMetroViewerProcessHost()); 53 metro_viewer_process_host_.reset(new ChromeMetroViewerProcessHost());
54 if (launch) { 54 if (launch) {
55 CHECK(metro_viewer_process_host_->LaunchViewerAndWaitForConnection( 55 CHECK(metro_viewer_process_host_->LaunchViewerAndWaitForConnection(
56 command_line.GetSwitchValueNative( 56 command_line.GetSwitchValueNative(
57 switches::kViewerLaunchViaAppId))); 57 switches::kViewerLaunchViaAppId)));
58 } 58 }
59
60 } 59 }
61 60
62 void BrowserProcessPlatformPart::Observe( 61 void BrowserProcessPlatformPart::Observe(
63 int type, 62 int type,
64 const content::NotificationSource& source, 63 const content::NotificationSource& source,
65 const content::NotificationDetails& details) { 64 const content::NotificationDetails& details) {
66 65
67 DCHECK(type == chrome::NOTIFICATION_APP_TERMINATING); 66 DCHECK(type == chrome::NOTIFICATION_APP_TERMINATING);
68 PrefService* pref_service = g_browser_process->local_state(); 67 PrefService* pref_service = g_browser_process->local_state();
69 bool is_relaunch = pref_service->GetBoolean(prefs::kWasRestarted); 68 bool is_relaunch = pref_service->GetBoolean(prefs::kWasRestarted);
70 if (is_relaunch) { 69 if (is_relaunch) {
71 upgrade_util::RelaunchMode mode = 70 // TODO(scottmg): A lot of this can be removed http://crbug.com/558054.
72 upgrade_util::RelaunchModeStringToEnum(
73 pref_service->GetString(prefs::kRelaunchMode));
74 if (metro_viewer_process_host_.get()) {
75 if (mode == upgrade_util::RELAUNCH_MODE_DESKTOP) {
76 // Metro -> Desktop
77 chrome::ActivateDesktopHelper(chrome::ASH_TERMINATE);
78 } else {
79 // Metro -> Metro
80 ChromeMetroViewerProcessHost::HandleMetroExit();
81 }
82 }
83 } 71 }
84 } 72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698