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/jumplist_win.h" | 5 #include "chrome/browser/jumplist_win.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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 // TabRestoreService object. This pointer is used when we remove this object | 506 // TabRestoreService object. This pointer is used when we remove this object |
507 // from the observer list. | 507 // from the observer list. |
508 if (base::win::GetVersion() < base::win::VERSION_WIN7 || !profile) | 508 if (base::win::GetVersion() < base::win::VERSION_WIN7 || !profile) |
509 return false; | 509 return false; |
510 | 510 |
511 TabRestoreService* tab_restore_service = | 511 TabRestoreService* tab_restore_service = |
512 TabRestoreServiceFactory::GetForProfile(profile); | 512 TabRestoreServiceFactory::GetForProfile(profile); |
513 if (!tab_restore_service) | 513 if (!tab_restore_service) |
514 return false; | 514 return false; |
515 | 515 |
516 app_id_ = ShellIntegration::GetChromiumAppId(profile->GetPath()); | 516 app_id_ = ShellIntegration::GetChromiumModelId(profile->GetPath()); |
517 icon_dir_ = profile->GetPath().Append(chrome::kJumpListIconDirname); | 517 icon_dir_ = profile->GetPath().Append(chrome::kJumpListIconDirname); |
518 profile_ = profile; | 518 profile_ = profile; |
519 history::TopSites* top_sites = profile_->GetTopSites(); | 519 history::TopSites* top_sites = profile_->GetTopSites(); |
520 if (top_sites) { | 520 if (top_sites) { |
521 // TopSites updates itself after a delay. This is especially noticable when | 521 // TopSites updates itself after a delay. This is especially noticable when |
522 // your profile is empty. Ask TopSites to update itself when jumplist is | 522 // your profile is empty. Ask TopSites to update itself when jumplist is |
523 // initialized. | 523 // initialized. |
524 top_sites->SyncWithHistory(); | 524 top_sites->SyncWithHistory(); |
525 registrar_.reset(new content::NotificationRegistrar); | 525 registrar_.reset(new content::NotificationRegistrar); |
526 // Register for notification when TopSites changes so that we can update | 526 // Register for notification when TopSites changes so that we can update |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 if ((*item)->data().get() && | 783 if ((*item)->data().get() && |
784 gfx::PNGCodec::Decode((*item)->data()->front(), | 784 gfx::PNGCodec::Decode((*item)->data()->front(), |
785 (*item)->data()->size(), | 785 (*item)->data()->size(), |
786 &icon_bitmap)) { | 786 &icon_bitmap)) { |
787 FilePath icon_path; | 787 FilePath icon_path; |
788 if (CreateIconFile(icon_bitmap, icon_dir_, &icon_path)) | 788 if (CreateIconFile(icon_bitmap, icon_dir_, &icon_path)) |
789 (*item)->SetIcon(icon_path.value(), 0, true); | 789 (*item)->SetIcon(icon_path.value(), 0, true); |
790 } | 790 } |
791 } | 791 } |
792 } | 792 } |
OLD | NEW |