| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/jumplist_win.h" | 5 #include "chrome/browser/jumplist_win.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "ui/gfx/image/image_family.h" | 45 #include "ui/gfx/image/image_family.h" |
| 46 #include "url/gurl.h" | 46 #include "url/gurl.h" |
| 47 | 47 |
| 48 using content::BrowserThread; | 48 using content::BrowserThread; |
| 49 | 49 |
| 50 namespace { | 50 namespace { |
| 51 | 51 |
| 52 // Append the common switches to each shell link. | 52 // Append the common switches to each shell link. |
| 53 void AppendCommonSwitches(ShellLinkItem* shell_link) { | 53 void AppendCommonSwitches(ShellLinkItem* shell_link) { |
| 54 const char* kSwitchNames[] = { switches::kUserDataDir }; | 54 const char* kSwitchNames[] = { switches::kUserDataDir }; |
| 55 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 55 const base::CommandLine& command_line = |
| 56 *base::CommandLine::ForCurrentProcess(); |
| 56 shell_link->GetCommandLine()->CopySwitchesFrom(command_line, | 57 shell_link->GetCommandLine()->CopySwitchesFrom(command_line, |
| 57 kSwitchNames, | 58 kSwitchNames, |
| 58 arraysize(kSwitchNames)); | 59 arraysize(kSwitchNames)); |
| 59 } | 60 } |
| 60 | 61 |
| 61 // Create a ShellLinkItem preloaded with common switches. | 62 // Create a ShellLinkItem preloaded with common switches. |
| 62 scoped_refptr<ShellLinkItem> CreateShellLink() { | 63 scoped_refptr<ShellLinkItem> CreateShellLink() { |
| 63 scoped_refptr<ShellLinkItem> link(new ShellLinkItem); | 64 scoped_refptr<ShellLinkItem> link(new ShellLinkItem); |
| 64 AppendCommonSwitches(link.get()); | 65 AppendCommonSwitches(link.get()); |
| 65 return link; | 66 return link; |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 link->set_icon_data(avatar.AsBitmap()); | 601 link->set_icon_data(avatar.AsBitmap()); |
| 601 new_profile_switcher.push_back(link); | 602 new_profile_switcher.push_back(link); |
| 602 } | 603 } |
| 603 } | 604 } |
| 604 | 605 |
| 605 { | 606 { |
| 606 base::AutoLock auto_lock(list_lock_); | 607 base::AutoLock auto_lock(list_lock_); |
| 607 new_profile_switcher.swap(profile_switcher_); | 608 new_profile_switcher.swap(profile_switcher_); |
| 608 } | 609 } |
| 609 } | 610 } |
| OLD | NEW |