| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/browser/browser_thread.h" | 12 #include "chrome/browser/browser_thread.h" |
| 13 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 | 15 |
| 16 ShellIntegration::ShortcutInfo::ShortcutInfo() | 16 ShellIntegration::ShortcutInfo::ShortcutInfo() |
| 17 : create_on_desktop(false), | 17 : create_on_desktop(false), |
| 18 create_in_applications_menu(false), | 18 create_in_applications_menu(false), |
| 19 create_in_quick_launch_bar(false) { | 19 create_in_quick_launch_bar(false) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 ShellIntegration::ShortcutInfo::~ShortcutInfo() {} | 22 ShellIntegration::ShortcutInfo::~ShortcutInfo() {} |
| 23 | 23 |
| 24 std::string ShellIntegration::GetCommandLineArgumentsCommon(const GURL& url, | 24 std::string ShellIntegration::GetCommandLineArgumentsCommon( |
| 25 const GURL& url, |
| 25 const string16& extension_app_id) { | 26 const string16& extension_app_id) { |
| 26 const CommandLine cmd = *CommandLine::ForCurrentProcess(); | 27 const CommandLine cmd = *CommandLine::ForCurrentProcess(); |
| 27 std::wstring arguments_w; | 28 std::wstring arguments_w; |
| 28 | 29 |
| 29 // Use the same UserDataDir for new launches that we currently have set. | 30 // Use the same UserDataDir for new launches that we currently have set. |
| 30 FilePath user_data_dir = cmd.GetSwitchValuePath(switches::kUserDataDir); | 31 FilePath user_data_dir = cmd.GetSwitchValuePath(switches::kUserDataDir); |
| 31 if (!user_data_dir.value().empty()) { | 32 if (!user_data_dir.value().empty()) { |
| 32 // Make sure user_data_dir is an absolute path. | 33 // Make sure user_data_dir is an absolute path. |
| 33 if (file_util::AbsolutePath(&user_data_dir) && | 34 if (file_util::AbsolutePath(&user_data_dir) && |
| 34 file_util::PathExists(user_data_dir)) { | 35 file_util::PathExists(user_data_dir)) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 observer_->SetDefaultBrowserUIState(STATE_IS_DEFAULT); | 150 observer_->SetDefaultBrowserUIState(STATE_IS_DEFAULT); |
| 150 break; | 151 break; |
| 151 case UNKNOWN_DEFAULT_BROWSER: | 152 case UNKNOWN_DEFAULT_BROWSER: |
| 152 observer_->SetDefaultBrowserUIState(STATE_UNKNOWN); | 153 observer_->SetDefaultBrowserUIState(STATE_UNKNOWN); |
| 153 break; | 154 break; |
| 154 default: | 155 default: |
| 155 break; | 156 break; |
| 156 } | 157 } |
| 157 } | 158 } |
| 158 } | 159 } |
| OLD | NEW |