diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-16 18:02:09 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-16 18:02:09 +0000 |
commit | 8fb6a8d96860124354f7fd5ecab378d47644fc07 (patch) | |
tree | 14c2b467aa36e249b22a9000d926ec3dac8294b7 /chrome/browser | |
parent | 5af8527e5662edc372f7c4f075b88e550995b830 (diff) | |
download | chromium_src-8fb6a8d96860124354f7fd5ecab378d47644fc07.zip chromium_src-8fb6a8d96860124354f7fd5ecab378d47644fc07.tar.gz chromium_src-8fb6a8d96860124354f7fd5ecab378d47644fc07.tar.bz2 |
Move winaura specific methods and members from chrome/browser/browser_process.h to chrome/browser/browser_process_platform_part_winaura.h
Precursor CL to https://codereview.chromium.org/14576015/
BUG=235648, 232842, 179830
Review URL: https://chromiumcodereview.appspot.com/14698027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser_process.h | 9 | ||||
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 11 | ||||
-rw-r--r-- | chrome/browser/browser_process_impl.h | 17 | ||||
-rw-r--r-- | chrome/browser/browser_process_platform_part.cc | 4 | ||||
-rw-r--r-- | chrome/browser/browser_process_platform_part.h | 7 | ||||
-rw-r--r-- | chrome/browser/browser_process_platform_part_aurawin.cc (renamed from chrome/browser/browser_process_impl_win.cc) | 30 | ||||
-rw-r--r-- | chrome/browser/browser_process_platform_part_aurawin.h | 37 | ||||
-rw-r--r-- | chrome/browser/browser_process_platform_part_chromeos.cc | 4 | ||||
-rw-r--r-- | chrome/browser/browser_process_platform_part_chromeos.h | 7 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_main.cc | 9 | ||||
-rw-r--r-- | chrome/browser/metro_viewer/metro_viewer_process_host_win.cc | 3 | ||||
-rw-r--r-- | chrome/browser/process_singleton_win.cc | 8 |
12 files changed, 92 insertions, 54 deletions
diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h index 22b347c..9e43e1a 100644 --- a/chrome/browser/browser_process.h +++ b/chrome/browser/browser_process.h @@ -20,7 +20,6 @@ class BackgroundModeManager; class BookmarkPromptController; class BrowserProcessPlatformPart; class ChromeNetLog; -class CommandLine; class CRLSetFetcher; class ComponentUpdateService; class DownloadRequestLimiter; @@ -213,16 +212,8 @@ class BrowserProcess { virtual chrome::MediaFileSystemRegistry* media_file_system_registry() = 0; - virtual void PlatformSpecificCommandLineProcessing( - const CommandLine& command_line) = 0; - virtual bool created_local_state() const = 0; -#if defined(OS_WIN) && defined(USE_AURA) - // Invoked when the ASH metro viewer process on Windows 8 exits. - virtual void OnMetroViewerProcessTerminated() = 0; -#endif - private: DISALLOW_COPY_AND_ASSIGN(BrowserProcess); }; diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 2906ce0..4e4b254 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -99,9 +99,6 @@ #if defined(OS_WIN) #include "base/win/windows_version.h" #include "ui/views/focus/view_storage.h" -#if defined(USE_AURA) -#include "chrome/browser/metro_viewer/metro_viewer_process_host_win.h" -#endif #elif defined(OS_MACOSX) #include "chrome/browser/chrome_browser_main_mac.h" #endif @@ -112,6 +109,8 @@ #if defined(OS_CHROMEOS) #include "chrome/browser/browser_process_platform_part_chromeos.h" +#elif defined(OS_WIN) && defined(USE_AURA) +#include "chrome/browser/browser_process_platform_part_aurawin.h" #else #include "chrome/browser/browser_process_platform_part.h" #endif // defined(OS_CHROMEOS) @@ -634,12 +633,6 @@ BrowserProcessImpl::media_file_system_registry() { #endif } -#if !defined(OS_WIN) -void BrowserProcessImpl::PlatformSpecificCommandLineProcessing( - const CommandLine& command_line) { -} -#endif - bool BrowserProcessImpl::created_local_state() const { return created_local_state_; } diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h index 7010aa3..0479e31 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h @@ -41,10 +41,6 @@ class BrowserPolicyConnector; class PolicyService; }; -#if defined(OS_WIN) && defined(USE_AURA) -class MetroViewerProcessHost; -#endif - #if defined(OS_MACOSX) class AppShimHostManager; #endif @@ -132,12 +128,7 @@ class BrowserProcessImpl : public BrowserProcess, virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; virtual chrome::MediaFileSystemRegistry* media_file_system_registry() OVERRIDE; - virtual void PlatformSpecificCommandLineProcessing( - const CommandLine& command_line) OVERRIDE; virtual bool created_local_state() const OVERRIDE; -#if defined(OS_WIN) && defined(USE_AURA) - virtual void OnMetroViewerProcessTerminated() OVERRIDE; -#endif static void RegisterPrefs(PrefRegistrySimple* registry); @@ -292,14 +283,6 @@ class BrowserProcessImpl : public BrowserProcess, scoped_refptr<PluginsResourceService> plugins_resource_service_; #endif -#if defined(OS_WIN) && defined(USE_AURA) - void PerformInitForWindowsAura(const CommandLine& command_line); - - // Hosts the channel for the Windows 8 metro viewer process which runs in - // the ASH environment. - scoped_ptr<MetroViewerProcessHost> metro_viewer_process_host_; -#endif - #if defined(OS_MACOSX) // Hosts the IPC channel factory that App Shims connect to on Mac. scoped_ptr<AppShimHostManager> app_shim_host_manager_; diff --git a/chrome/browser/browser_process_platform_part.cc b/chrome/browser/browser_process_platform_part.cc index 6b71dfc..d5afefb 100644 --- a/chrome/browser/browser_process_platform_part.cc +++ b/chrome/browser/browser_process_platform_part.cc @@ -10,5 +10,9 @@ BrowserProcessPlatformPart::BrowserProcessPlatformPart() { BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { } +void BrowserProcessPlatformPart::PlatformSpecificCommandLineProcessing( + const CommandLine& /* command_line */) { +} + void BrowserProcessPlatformPart::StartTearDown() { } diff --git a/chrome/browser/browser_process_platform_part.h b/chrome/browser/browser_process_platform_part.h index 817ea9f..01000a0 100644 --- a/chrome/browser/browser_process_platform_part.h +++ b/chrome/browser/browser_process_platform_part.h @@ -7,11 +7,18 @@ #include "base/basictypes.h" +class CommandLine; + class BrowserProcessPlatformPart { public: BrowserProcessPlatformPart(); virtual ~BrowserProcessPlatformPart(); + // Called after creating the process singleton or when another chrome + // rendez-vous with this one. + virtual void PlatformSpecificCommandLineProcessing( + const CommandLine& command_line); + // Called from BrowserProcessImpl::StartTearDown(). virtual void StartTearDown(); diff --git a/chrome/browser/browser_process_impl_win.cc b/chrome/browser/browser_process_platform_part_aurawin.cc index 9d013fd..305c208 100644 --- a/chrome/browser/browser_process_impl_win.cc +++ b/chrome/browser/browser_process_platform_part_aurawin.cc @@ -1,28 +1,20 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/browser_process_impl.h" -#include "base/command_line.h" -#include "chrome/common/chrome_switches.h" +#include "chrome/browser/browser_process_platform_part_aurawin.h" -#if defined(USE_AURA) +#include "base/command_line.h" #include "chrome/browser/metro_viewer/metro_viewer_process_host_win.h" -#endif +#include "chrome/common/chrome_switches.h" -void BrowserProcessImpl::PlatformSpecificCommandLineProcessing( - const CommandLine& command_line) { -#if defined(USE_AURA) - PerformInitForWindowsAura(command_line); -#endif +BrowserProcessPlatformPart::BrowserProcessPlatformPart() { } -#if defined(USE_AURA) -void BrowserProcessImpl::OnMetroViewerProcessTerminated() { - metro_viewer_process_host_.reset(NULL); +BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { } -void BrowserProcessImpl::PerformInitForWindowsAura( +void BrowserProcessPlatformPart::PlatformSpecificCommandLineProcessing( const CommandLine& command_line) { if (command_line.HasSwitch(switches::kViewerConnection) && !metro_viewer_process_host_.get()) { @@ -32,4 +24,10 @@ void BrowserProcessImpl::PerformInitForWindowsAura( command_line.GetSwitchValueASCII(switches::kViewerConnection))); } } -#endif + +void BrowserProcessPlatformPart::StartTearDown() { +} + +void BrowserProcessPlatformPart::OnMetroViewerProcessTerminated() { + metro_viewer_process_host_.reset(NULL); +} diff --git a/chrome/browser/browser_process_platform_part_aurawin.h b/chrome/browser/browser_process_platform_part_aurawin.h new file mode 100644 index 0000000..d0c457f --- /dev/null +++ b/chrome/browser/browser_process_platform_part_aurawin.h @@ -0,0 +1,37 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_AURAWIN_H_ +#define CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_AURAWIN_H_ + +#include "base/basictypes.h" +#include "base/memory/scoped_ptr.h" + +class CommandLine; +class MetroViewerProcessHost; + +class BrowserProcessPlatformPart { + public: + BrowserProcessPlatformPart(); + virtual ~BrowserProcessPlatformPart(); + + // Called after creating the process singleton or when another chrome + // rendez-vous with this one. + virtual void PlatformSpecificCommandLineProcessing( + const CommandLine& command_line); + + // Called from BrowserProcessImpl::StartTearDown(). + virtual void StartTearDown(); + + void OnMetroViewerProcessTerminated(); + + private: + // Hosts the channel for the Windows 8 metro viewer process which runs in + // the ASH environment. + scoped_ptr<MetroViewerProcessHost> metro_viewer_process_host_; + + DISALLOW_COPY_AND_ASSIGN(BrowserProcessPlatformPart); +}; + +#endif // CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_AURAWIN_H_ diff --git a/chrome/browser/browser_process_platform_part_chromeos.cc b/chrome/browser/browser_process_platform_part_chromeos.cc index ab5c21f..25f881d 100644 --- a/chrome/browser/browser_process_platform_part_chromeos.cc +++ b/chrome/browser/browser_process_platform_part_chromeos.cc @@ -14,6 +14,10 @@ BrowserProcessPlatformPart::BrowserProcessPlatformPart() BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { } +void BrowserProcessPlatformPart::PlatformSpecificCommandLineProcessing( + const CommandLine& /* command_line */) { +} + void BrowserProcessPlatformPart::StartTearDown() { profile_helper_.reset(); } diff --git a/chrome/browser/browser_process_platform_part_chromeos.h b/chrome/browser/browser_process_platform_part_chromeos.h index f070546..5976302 100644 --- a/chrome/browser/browser_process_platform_part_chromeos.h +++ b/chrome/browser/browser_process_platform_part_chromeos.h @@ -9,6 +9,8 @@ #include "base/memory/scoped_ptr.h" #include "base/threading/non_thread_safe.h" +class CommandLine; + namespace chromeos { class OomPriorityManager; class ProfileHelper; @@ -19,6 +21,11 @@ class BrowserProcessPlatformPart : public base::NonThreadSafe { BrowserProcessPlatformPart(); virtual ~BrowserProcessPlatformPart(); + // Called after creating the process singleton or when another chrome + // rendez-vous with this one. + virtual void PlatformSpecificCommandLineProcessing( + const CommandLine& command_line); + // Called from BrowserProcessImpl::StartTearDown(). virtual void StartTearDown(); diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 70882be..1763b86 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -179,6 +179,12 @@ #include "ui/base/win/dpi.h" #endif // defined(OS_WIN) +#if defined(OS_WIN) && defined(USE_AURA) +#include "chrome/browser/browser_process_platform_part_aurawin.h" +#else +#include "chrome/browser/browser_process_platform_part.h" +#endif + #if defined(OS_MACOSX) #include <Security/Security.h> @@ -435,7 +441,8 @@ bool ProcessSingletonNotificationCallback( base::Time::Now() - base::Time::FromInternalValue(remote_start_time)); } - g_browser_process->PlatformSpecificCommandLineProcessing(command_line); + g_browser_process->platform_part()->PlatformSpecificCommandLineProcessing( + command_line); // TODO(erikwright): Consider removing this - AFAIK it is no longer used. // Handle the --uninstall-extension startup action. This needs to done here in diff --git a/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc b/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc index caf5984..ad279b1 100644 --- a/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc +++ b/chrome/browser/metro_viewer/metro_viewer_process_host_win.cc @@ -6,6 +6,7 @@ #include "base/logging.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/browser_process_platform_part_aurawin.h" #include "chrome/browser/ui/ash/ash_init.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" @@ -87,7 +88,7 @@ void MetroViewerProcessHost::OnChannelError() { // This will delete the MetroViewerProcessHost object. Don't access member // variables/functions after this call. - g_browser_process->OnMetroViewerProcessTerminated(); + g_browser_process->platform_part()->OnMetroViewerProcessTerminated(); } void MetroViewerProcessHost::OnSetTargetSurface( diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc index f8aaf81..237a4a2 100644 --- a/chrome/browser/process_singleton_win.cc +++ b/chrome/browser/process_singleton_win.cc @@ -38,6 +38,12 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/win/hwnd_util.h" +#if defined(USE_AURA) +#include "chrome/browser/browser_process_platform_part_aurawin.h" +#else +#include "chrome/browser/browser_process_platform_part.h" +#endif + namespace { const char kLockfile[] = "lockfile"; @@ -406,7 +412,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() { if (result == PROCESS_NONE) result = PROFILE_IN_USE; } else { - g_browser_process->PlatformSpecificCommandLineProcessing( + g_browser_process->platform_part()->PlatformSpecificCommandLineProcessing( *CommandLine::ForCurrentProcess()); } return result; |