diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-13 01:39:31 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-13 01:39:31 +0000 |
commit | e7f7987f346d1e69725a75ab337148f2bf517186 (patch) | |
tree | 1ceb7a8b8b35b9d6b1b516bfe4e7bbd6fe7c4020 /chrome/browser | |
parent | 517c79c4ae1e9def0836a6fa59bf10fae1981a9c (diff) | |
download | chromium_src-e7f7987f346d1e69725a75ab337148f2bf517186.zip chromium_src-e7f7987f346d1e69725a75ab337148f2bf517186.tar.gz chromium_src-e7f7987f346d1e69725a75ab337148f2bf517186.tar.bz2 |
chromeos: Don't compile Linux shell-integration code.
This avoids a bunch of log spam at startup about failed XDG
commands. It also makes the default-browser prompt code not
get compiled for Chrome OS.
BUG=287894
Review URL: https://chromiumcodereview.appspot.com/23572036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222946 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/OWNERS | 1 | ||||
-rw-r--r-- | chrome/browser/defaults.cc | 6 | ||||
-rw-r--r-- | chrome/browser/defaults.h | 4 | ||||
-rw-r--r-- | chrome/browser/prefs/browser_prefs.cc | 4 | ||||
-rw-r--r-- | chrome/browser/shell_integration.cc | 5 | ||||
-rw-r--r-- | chrome/browser/shell_integration_chromeos.cc | 38 | ||||
-rw-r--r-- | chrome/browser/shell_integration_linux_unittest.cc (renamed from chrome/browser/shell_integration_unittest.cc) | 13 | ||||
-rw-r--r-- | chrome/browser/ui/startup/startup_browser_creator_impl.cc | 5 | ||||
-rw-r--r-- | chrome/browser/ui/views/apps/native_app_window_views.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/browser_frame.cc | 4 | ||||
-rw-r--r-- | chrome/browser/web_applications/web_app_chromeos.cc | 30 |
11 files changed, 83 insertions, 29 deletions
diff --git a/chrome/browser/OWNERS b/chrome/browser/OWNERS index b614afe..52ba09c 100644 --- a/chrome/browser/OWNERS +++ b/chrome/browser/OWNERS @@ -14,4 +14,3 @@ per-file enumerate_modules_model*=finnur@chromium.org per-file shell_integration_win*=gab@chromium.org per-file shell_integration_win*=grt@chromium.org per-file shell_integration_linux*=erg@chromium.org -per-file shell_integration_unittest.cc=erg@chromium.org diff --git a/chrome/browser/defaults.cc b/chrome/browser/defaults.cc index 750f05c..7578f70 100644 --- a/chrome/browser/defaults.cc +++ b/chrome/browser/defaults.cc @@ -49,12 +49,6 @@ const bool kAlwaysOpenIncognitoWindow = false; const bool kAlwaysCreateTabbedBrowserOnSessionRestore = true; #endif -#if defined(OS_CHROMEOS) -const bool kOSSupportsOtherBrowsers = false; -#else -const bool kOSSupportsOtherBrowsers = true; -#endif - const bool kDownloadPageHasShowInFolder = true; const bool kSizeTabButtonToTopOfTabStrip = false; diff --git a/chrome/browser/defaults.h b/chrome/browser/defaults.h index 0a14470..1e06152 100644 --- a/chrome/browser/defaults.h +++ b/chrome/browser/defaults.h @@ -50,10 +50,6 @@ extern const bool kAlwaysOpenIncognitoWindow; // where we want the desktop to show through in this situation. extern const bool kAlwaysCreateTabbedBrowserOnSessionRestore; -// Does the OS support other browsers? If not, operations such as default -// browser check are not done. -extern const bool kOSSupportsOtherBrowsers; - // Does the download page have the show in folder option? extern const bool kDownloadPageHasShowInFolder; diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 990249f..76ae923 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc @@ -259,8 +259,10 @@ void RegisterLocalState(PrefRegistrySimple* registry) { #if !defined(OS_ANDROID) BackgroundModeManager::RegisterPrefs(registry); RegisterBrowserPrefs(registry); +#if !defined(OS_CHROMEOS) RegisterDefaultBrowserPromptPrefs(registry); -#endif +#endif // !defined(OS_CHROMEOS) +#endif // !defined(OS_ANDROID) #if defined(OS_CHROMEOS) chromeos::AudioDevicesPrefHandlerImpl::RegisterPrefs(registry); diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc index 505d87b..e295904 100644 --- a/chrome/browser/shell_integration.cc +++ b/chrome/browser/shell_integration.cc @@ -288,6 +288,9 @@ bool ShellIntegration::DefaultProtocolClientWorker::SetAsDefault( bool interactive_permitted) { bool result = false; switch (ShellIntegration::CanSetAsDefaultProtocolClient()) { + case ShellIntegration::SET_DEFAULT_NOT_ALLOWED: + result = false; + break; case ShellIntegration::SET_DEFAULT_UNATTENDED: result = ShellIntegration::SetAsDefaultProtocolClient(protocol_); break; @@ -297,8 +300,6 @@ bool ShellIntegration::DefaultProtocolClientWorker::SetAsDefault( protocol_); } break; - default: - NOTREACHED(); } return result; diff --git a/chrome/browser/shell_integration_chromeos.cc b/chrome/browser/shell_integration_chromeos.cc new file mode 100644 index 0000000..03c82a0 --- /dev/null +++ b/chrome/browser/shell_integration_chromeos.cc @@ -0,0 +1,38 @@ +// Copyright 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/shell_integration.h" + +// static +ShellIntegration::DefaultWebClientSetPermission + ShellIntegration::CanSetAsDefaultBrowser() { + return SET_DEFAULT_NOT_ALLOWED; +} + +// static +bool ShellIntegration::SetAsDefaultBrowser() { + return false; +} + +// static +bool ShellIntegration::SetAsDefaultProtocolClient(const std::string& protocol) { + return false; +} + +// static +ShellIntegration::DefaultWebClientState ShellIntegration::GetDefaultBrowser() { + return UNKNOWN_DEFAULT; +} + +// static +ShellIntegration::DefaultWebClientState +ShellIntegration::IsDefaultProtocolClient(const std::string& protocol) { + return UNKNOWN_DEFAULT; +} + +// static +bool ShellIntegration::IsFirefoxDefaultBrowser() { + return false; +} + diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_linux_unittest.cc index e3ab231..9bf6ec4 100644 --- a/chrome/browser/shell_integration_unittest.cc +++ b/chrome/browser/shell_integration_linux_unittest.cc @@ -1,14 +1,15 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 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/shell_integration.h" +#include "chrome/browser/shell_integration_linux.h" #include <algorithm> #include <cstdlib> #include <map> #include "base/base_paths.h" +#include "base/environment.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" @@ -24,17 +25,11 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" -#if defined(OS_POSIX) && !defined(OS_MACOSX) -#include "base/environment.h" -#include "chrome/browser/shell_integration_linux.h" -#endif - #define FPL FILE_PATH_LITERAL using content::BrowserThread; using ::testing::ElementsAre; -#if defined(OS_POSIX) && !defined(OS_MACOSX) namespace { // Provides mock environment variables values based on a stored map. @@ -611,5 +606,3 @@ TEST(ShellIntegrationTest, GetDirectoryFileContents) { test_cases[i].icon_name)); } } - -#endif diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc index 59287b0..0bd8cd1 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc @@ -883,8 +883,8 @@ void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( ObsoleteOSInfoBarDelegate::Create(InfoBarService::FromWebContents( browser->tab_strip_model()->GetActiveWebContents())); - if (browser_defaults::kOSSupportsOtherBrowsers && - !command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) { +#if !defined(OS_CHROMEOS) + if (!command_line_.HasSwitch(switches::kNoDefaultBrowserCheck)) { // Generally, the default browser prompt should not be shown on first // run. However, when the set-as-default dialog has been suppressed, we // need to allow it. @@ -896,6 +896,7 @@ void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( browser->host_desktop_type()); } } +#endif } } diff --git a/chrome/browser/ui/views/apps/native_app_window_views.cc b/chrome/browser/ui/views/apps/native_app_window_views.cc index 42da919..1a64752 100644 --- a/chrome/browser/ui/views/apps/native_app_window_views.cc +++ b/chrome/browser/ui/views/apps/native_app_window_views.cc @@ -175,7 +175,7 @@ void NativeAppWindowViews::InitializeDefaultWindow( if (position_specified && !window_bounds.IsEmpty()) init_params.bounds = window_bounds; -#if defined(OS_LINUX) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) // Set up a custom WM_CLASS for app windows. This allows task switchers in // X11 environments to distinguish them from main browser windows. init_params.wm_class_name = web_app::GetWMClassFromAppName(app_name); diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc index 09bed7b..78b56a8 100644 --- a/chrome/browser/ui/views/frame/browser_frame.cc +++ b/chrome/browser/ui/views/frame/browser_frame.cc @@ -35,7 +35,7 @@ #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" #endif -#if defined(OS_LINUX) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) #include "chrome/browser/shell_integration_linux.h" #endif @@ -82,7 +82,7 @@ void BrowserFrame::InitBrowserFrame() { } #endif -#if defined(OS_LINUX) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) // Set up a custom WM_CLASS for some sorts of window types. This allows // task switchers in X11 environments to distinguish between main browser // windows and e.g app windows. diff --git a/chrome/browser/web_applications/web_app_chromeos.cc b/chrome/browser/web_applications/web_app_chromeos.cc new file mode 100644 index 0000000..76de546 --- /dev/null +++ b/chrome/browser/web_applications/web_app_chromeos.cc @@ -0,0 +1,30 @@ +// Copyright 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/web_applications/web_app.h" + +namespace web_app { +namespace internals { + +bool CreatePlatformShortcuts( + const base::FilePath& web_app_path, + const ShellIntegration::ShortcutInfo& shortcut_info, + const ShellIntegration::ShortcutLocations& creation_locations, + ShortcutCreationReason creation_reason) { + return true; +} + +void DeletePlatformShortcuts( + const base::FilePath& web_app_path, + const ShellIntegration::ShortcutInfo& shortcut_info) {} + +void UpdatePlatformShortcuts( + const base::FilePath& web_app_path, + const string16& old_app_title, + const ShellIntegration::ShortcutInfo& shortcut_info) {} + +void DeleteAllShortcutsForProfile(const base::FilePath& profile_path) {} + +} // namespace internals +} // namespace web_app |