| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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/jumplist.h" | 5 #include "chrome/browser/jumplist.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shobjidl.h> | 8 #include <shobjidl.h> |
| 9 #include <propkey.h> | 9 #include <propkey.h> |
| 10 #include <propvarutil.h> | 10 #include <propvarutil.h> |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 JumpList::JumpList() : profile_(NULL) { | 531 JumpList::JumpList() : profile_(NULL) { |
| 532 } | 532 } |
| 533 | 533 |
| 534 JumpList::~JumpList() { | 534 JumpList::~JumpList() { |
| 535 RemoveObserver(); | 535 RemoveObserver(); |
| 536 } | 536 } |
| 537 | 537 |
| 538 // static | 538 // static |
| 539 bool JumpList::Enabled() { | 539 bool JumpList::Enabled() { |
| 540 return (win_util::GetWinVersion() >= win_util::WINVERSION_WIN7 && | 540 return (win_util::GetWinVersion() >= win_util::WINVERSION_WIN7 && |
| 541 CommandLine::ForCurrentProcess()->HasSwitch( | 541 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 542 switches::kEnableCustomJumpList)); | 542 switches::kDisableCustomJumpList)); |
| 543 } | 543 } |
| 544 | 544 |
| 545 bool JumpList::AddObserver(Profile* profile) { | 545 bool JumpList::AddObserver(Profile* profile) { |
| 546 // To update JumpList when a tab is added or removed, we add this object to | 546 // To update JumpList when a tab is added or removed, we add this object to |
| 547 // the observer list of the TabRestoreService class. | 547 // the observer list of the TabRestoreService class. |
| 548 // When we add this object to the observer list, we save the pointer to this | 548 // When we add this object to the observer list, we save the pointer to this |
| 549 // TabRestoreService object. This pointer is used when we remove this object | 549 // TabRestoreService object. This pointer is used when we remove this object |
| 550 // from the observer list. | 550 // from the observer list. |
| 551 if (win_util::GetWinVersion() < win_util::WINVERSION_WIN7 || !profile) | 551 if (win_util::GetWinVersion() < win_util::WINVERSION_WIN7 || !profile) |
| 552 return false; | 552 return false; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 most_visited_pages_, | 727 most_visited_pages_, |
| 728 recently_closed_pages_); | 728 recently_closed_pages_); |
| 729 MessageLoop* file_loop = g_browser_process->file_thread()->message_loop(); | 729 MessageLoop* file_loop = g_browser_process->file_thread()->message_loop(); |
| 730 if (file_loop) | 730 if (file_loop) |
| 731 file_loop->PostTask(FROM_HERE, icon_task); | 731 file_loop->PostTask(FROM_HERE, icon_task); |
| 732 | 732 |
| 733 // Delete all items in these lists since we don't need these lists any longer. | 733 // Delete all items in these lists since we don't need these lists any longer. |
| 734 most_visited_pages_.clear(); | 734 most_visited_pages_.clear(); |
| 735 recently_closed_pages_.clear(); | 735 recently_closed_pages_.clear(); |
| 736 } | 736 } |
| OLD | NEW |