From 81ce2c47705894ebdba4344f483bc4cb8f072155 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Sat, 24 Mar 2012 01:43:26 +0000 Subject: Make chrome/browser/chrome_browser_main_linux.* Linux-only. BUG=none TEST=none Review URL: http://codereview.chromium.org/9839028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128650 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/chrome_browser_main_extra_parts_gtk.h | 4 +++- .../browser/chrome_browser_main_extra_parts_views.h | 5 ++++- chrome/browser/chrome_browser_main_linux.cc | 18 +----------------- chrome/browser/chrome_browser_main_linux.h | 6 +++--- chrome/browser/chrome_browser_main_mac.h | 8 ++++---- chrome/browser/chrome_browser_main_mac.mm | 5 ----- chrome/browser/chrome_browser_main_posix.cc | 20 ++++++++++++++++++++ chrome/browser/chrome_browser_main_posix.h | 15 +++++++++++---- chrome/browser/chrome_browser_main_win.h | 5 ++++- chrome/browser/chrome_content_browser_client.cc | 4 ++-- 10 files changed, 52 insertions(+), 38 deletions(-) diff --git a/chrome/browser/chrome_browser_main_extra_parts_gtk.h b/chrome/browser/chrome_browser_main_extra_parts_gtk.h index 34b596f..ca962cf 100644 --- a/chrome/browser/chrome_browser_main_extra_parts_gtk.h +++ b/chrome/browser/chrome_browser_main_extra_parts_gtk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -21,6 +21,8 @@ class ChromeBrowserMainExtraPartsGtk : public ChromeBrowserMainExtraParts { private: void DetectRunningAsRoot(); + + DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsGtk); }; #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_EXTRA_PARTS_GTK_H_ diff --git a/chrome/browser/chrome_browser_main_extra_parts_views.h b/chrome/browser/chrome_browser_main_extra_parts_views.h index 6ac14c7..a7937e7 100644 --- a/chrome/browser/chrome_browser_main_extra_parts_views.h +++ b/chrome/browser/chrome_browser_main_extra_parts_views.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -16,6 +16,9 @@ class ChromeBrowserMainExtraPartsViews : public ChromeBrowserMainExtraParts { ChromeBrowserMainExtraPartsViews(); virtual void ToolkitInitialized() OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsViews); }; #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_EXTRA_PARTS_VIEWS_H_ diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc index 4900de6..b27580d 100644 --- a/chrome/browser/chrome_browser_main_linux.cc +++ b/chrome/browser/chrome_browser_main_linux.cc @@ -1,26 +1,10 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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/chrome_browser_main_linux.h" -#if defined(TOOLKIT_USES_GTK) -#include "chrome/browser/chrome_browser_main_extra_parts_gtk.h" -#endif - ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( const content::MainFunctionParams& parameters) : ChromeBrowserMainPartsPosix(parameters) { } - -void ChromeBrowserMainPartsLinux::ShowMissingLocaleMessageBox() { -#if defined(USE_AURA) - // This should never happen on Aura. - NOTREACHED() << chrome_browser::kMissingLocaleDataMessage; -#elif defined(TOOLKIT_USES_GTK) - ChromeBrowserMainExtraPartsGtk::ShowMessageBox( - chrome_browser::kMissingLocaleDataMessage); -#else -#error "Need MessageBox implementation for linux without Aura or Gtk" -#endif -} diff --git a/chrome/browser/chrome_browser_main_linux.h b/chrome/browser/chrome_browser_main_linux.h index e9f3bee..dc125b21 100644 --- a/chrome/browser/chrome_browser_main_linux.h +++ b/chrome/browser/chrome_browser_main_linux.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -16,8 +16,8 @@ class ChromeBrowserMainPartsLinux : public ChromeBrowserMainPartsPosix { explicit ChromeBrowserMainPartsLinux( const content::MainFunctionParams& parameters); - // ChromeBrowserMainParts overrides. - virtual void ShowMissingLocaleMessageBox() OVERRIDE; + private: + DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsLinux); }; #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_LINUX_H_ diff --git a/chrome/browser/chrome_browser_main_mac.h b/chrome/browser/chrome_browser_main_mac.h index dc08bbf..79c454e 100644 --- a/chrome/browser/chrome_browser_main_mac.h +++ b/chrome/browser/chrome_browser_main_mac.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -17,12 +17,12 @@ class ChromeBrowserMainPartsMac : public ChromeBrowserMainPartsPosix { virtual void PreEarlyInitialization() OVERRIDE; virtual void PreMainMessageLoopStart() OVERRIDE; - // ChromeBrowserMainParts overrides. - virtual void ShowMissingLocaleMessageBox() OVERRIDE; - // Perform platform-specific work that needs to be done after the main event // loop has ended. The embedder must be sure to call this. static void DidEndMainMessageLoop(); + + private: + DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsMac); }; #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_MAC_H_ diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index b1fa31f..493f8ea 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm @@ -114,11 +114,6 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; } -void ChromeBrowserMainPartsMac::ShowMissingLocaleMessageBox() { - // Not called on Mac because we load the locale files differently. - NOTREACHED(); -} - void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { AppController* appController = [NSApp delegate]; [appController didEndMainMessageLoop]; diff --git a/chrome/browser/chrome_browser_main_posix.cc b/chrome/browser/chrome_browser_main_posix.cc index d99e6b3..d46986ab 100644 --- a/chrome/browser/chrome_browser_main_posix.cc +++ b/chrome/browser/chrome_browser_main_posix.cc @@ -27,6 +27,7 @@ #endif #if defined(TOOLKIT_USES_GTK) +#include "chrome/browser/chrome_browser_main_extra_parts_gtk.h" #include "chrome/browser/printing/print_dialog_gtk.h" #endif @@ -272,3 +273,22 @@ void ChromeBrowserMainPartsPosix::PostMainMessageLoopStart() { &PrintDialogGtk::CreatePrintDialog); #endif } + +void ChromeBrowserMainPartsPosix::ShowMissingLocaleMessageBox() { +#if defined(OS_CHROMEOS) + NOTREACHED(); // Should not ever happen on ChromeOS. +#elif defined(OS_ANDROID) + // TODO(port) Update this as needed. + // Probably should not ever happen on Android, but at the time of this + // writing, Android isn't even using ChromeBrowserMainPartsPosix yet. + NOTREACHED(); +#elif defined(OS_MACOSX) + // Not called on Mac because we load the locale files differently. + NOTREACHED(); +#elif defined(TOOLKIT_USES_GTK) + ChromeBrowserMainExtraPartsGtk::ShowMessageBox( + chrome_browser::kMissingLocaleDataMessage); +#else +#error "Need MessageBox implementation." +#endif +} diff --git a/chrome/browser/chrome_browser_main_posix.h b/chrome/browser/chrome_browser_main_posix.h index 6188de7..e8cab81 100644 --- a/chrome/browser/chrome_browser_main_posix.h +++ b/chrome/browser/chrome_browser_main_posix.h @@ -1,9 +1,9 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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_CHROME_MAIN_POSIX_H_ -#define CHROME_BROWSER_BROWSER_CHROME_MAIN_POSIX_H_ +#ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_POSIX_H_ +#define CHROME_BROWSER_CHROME_BROWSER_MAIN_POSIX_H_ #include "chrome/browser/chrome_browser_main.h" @@ -12,8 +12,15 @@ class ChromeBrowserMainPartsPosix : public ChromeBrowserMainParts { explicit ChromeBrowserMainPartsPosix( const content::MainFunctionParams& parameters); + // content::BrowserMainParts overrides. virtual void PreEarlyInitialization() OVERRIDE; virtual void PostMainMessageLoopStart() OVERRIDE; + + // ChromeBrowserMainParts overrides. + virtual void ShowMissingLocaleMessageBox() OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsPosix); }; -#endif // CHROME_BROWSER_BROWSER_CHROME_MAIN_POSIX_H_ +#endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_POSIX_H_ diff --git a/chrome/browser/chrome_browser_main_win.h b/chrome/browser/chrome_browser_main_win.h index 12b3dd1..3ba4a90 100644 --- a/chrome/browser/chrome_browser_main_win.h +++ b/chrome/browser/chrome_browser_main_win.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -52,6 +52,9 @@ class ChromeBrowserMainPartsWin : public ChromeBrowserMainParts { // allow the user level Chrome to run. So we notify the user and uninstall // user level Chrome. static bool CheckMachineLevelInstall(); + + private: + DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsWin); }; #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_WIN_H_ diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 76de231..1915f6b 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -102,7 +102,7 @@ #elif defined(OS_CHROMEOS) #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" #include "chrome/browser/chromeos/login/user_manager.h" -#elif defined(OS_LINUX) || defined(OS_OPENBSD) +#elif defined(OS_LINUX) #include "chrome/browser/chrome_browser_main_linux.h" #elif defined(OS_POSIX) #include "chrome/browser/chrome_browser_main_posix.h" @@ -323,7 +323,7 @@ content::BrowserMainParts* ChromeContentBrowserClient::CreateBrowserMainParts( main_parts = new ChromeBrowserMainPartsMac(parameters); #elif defined(OS_CHROMEOS) main_parts = new ChromeBrowserMainPartsChromeos(parameters); -#elif defined(OS_LINUX) || defined(OS_OPENBSD) +#elif defined(OS_LINUX) main_parts = new ChromeBrowserMainPartsLinux(parameters); #elif defined(OS_ANDROID) // Do nothing for Android. -- cgit v1.1