| OLD | NEW |
| 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/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 ShellIntegration::ShortcutInfo::ShortcutInfo() | 27 ShellIntegration::ShortcutInfo::ShortcutInfo() |
| 28 : is_platform_app(false), | 28 : is_platform_app(false), |
| 29 create_on_desktop(false), | 29 create_on_desktop(false), |
| 30 create_in_applications_menu(false), | 30 create_in_applications_menu(false), |
| 31 create_in_quick_launch_bar(false) { | 31 create_in_quick_launch_bar(false) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 ShellIntegration::ShortcutInfo::~ShortcutInfo() {} | 34 ShellIntegration::ShortcutInfo::~ShortcutInfo() {} |
| 35 | 35 |
| 36 static const struct ShellIntegration::AppModeInfo* gAppModeInfo = NULL; |
| 37 |
| 38 // static |
| 39 void ShellIntegration::SetAppModeInfo(const struct AppModeInfo* info) { |
| 40 gAppModeInfo = info; |
| 41 } |
| 42 |
| 43 // static |
| 44 const struct ShellIntegration::AppModeInfo* ShellIntegration::AppModeInfo() { |
| 45 return gAppModeInfo; |
| 46 } |
| 47 |
| 48 // static |
| 49 bool ShellIntegration::IsRunningInAppMode() { |
| 50 return gAppModeInfo != NULL; |
| 51 } |
| 52 |
| 36 // static | 53 // static |
| 37 CommandLine ShellIntegration::CommandLineArgsForLauncher( | 54 CommandLine ShellIntegration::CommandLineArgsForLauncher( |
| 38 const GURL& url, | 55 const GURL& url, |
| 39 const std::string& extension_app_id) { | 56 const std::string& extension_app_id) { |
| 40 const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); | 57 const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); |
| 41 CommandLine new_cmd_line(CommandLine::NO_PROGRAM); | 58 CommandLine new_cmd_line(CommandLine::NO_PROGRAM); |
| 42 | 59 |
| 43 // Use the same UserDataDir for new launches that we currently have set. | 60 // Use the same UserDataDir for new launches that we currently have set. |
| 44 FilePath user_data_dir = cmd_line.GetSwitchValuePath(switches::kUserDataDir); | 61 FilePath user_data_dir = cmd_line.GetSwitchValuePath(switches::kUserDataDir); |
| 45 if (!user_data_dir.empty()) { | 62 if (!user_data_dir.empty()) { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 // DefaultProtocolClientWorker, private: | 255 // DefaultProtocolClientWorker, private: |
| 239 | 256 |
| 240 ShellIntegration::DefaultWebClientState | 257 ShellIntegration::DefaultWebClientState |
| 241 ShellIntegration::DefaultProtocolClientWorker::CheckIsDefault() { | 258 ShellIntegration::DefaultProtocolClientWorker::CheckIsDefault() { |
| 242 return ShellIntegration::IsDefaultProtocolClient(protocol_); | 259 return ShellIntegration::IsDefaultProtocolClient(protocol_); |
| 243 } | 260 } |
| 244 | 261 |
| 245 void ShellIntegration::DefaultProtocolClientWorker::SetAsDefault() { | 262 void ShellIntegration::DefaultProtocolClientWorker::SetAsDefault() { |
| 246 ShellIntegration::SetAsDefaultProtocolClient(protocol_); | 263 ShellIntegration::SetAsDefaultProtocolClient(protocol_); |
| 247 } | 264 } |
| OLD | NEW |