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/browsing_data/cookies_tree_model.h" | 5 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 CookiesTreeModel::~CookiesTreeModel() { | 876 CookiesTreeModel::~CookiesTreeModel() { |
877 } | 877 } |
878 | 878 |
879 /////////////////////////////////////////////////////////////////////////////// | 879 /////////////////////////////////////////////////////////////////////////////// |
880 // CookiesTreeModel, TreeModel methods (public): | 880 // CookiesTreeModel, TreeModel methods (public): |
881 | 881 |
882 // TreeModel methods: | 882 // TreeModel methods: |
883 // Returns the set of icons for the nodes in the tree. You only need override | 883 // Returns the set of icons for the nodes in the tree. You only need override |
884 // this if you don't want to use the default folder icons. | 884 // this if you don't want to use the default folder icons. |
885 void CookiesTreeModel::GetIcons(std::vector<gfx::ImageSkia>* icons) { | 885 void CookiesTreeModel::GetIcons(std::vector<gfx::ImageSkia>* icons) { |
886 icons->push_back(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 886 icons->push_back(*ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
887 IDR_DEFAULT_FAVICON)); | 887 IDR_DEFAULT_FAVICON).ToImageSkia()); |
888 icons->push_back(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 888 icons->push_back(*ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
889 IDR_COOKIE_ICON)); | 889 IDR_COOKIE_ICON).ToImageSkia()); |
890 icons->push_back(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 890 icons->push_back(*ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
891 IDR_COOKIE_STORAGE_ICON)); | 891 IDR_COOKIE_STORAGE_ICON).ToImageSkia()); |
892 } | 892 } |
893 | 893 |
894 // Returns the index of the icon to use for |node|. Return -1 to use the | 894 // Returns the index of the icon to use for |node|. Return -1 to use the |
895 // default icon. The index is relative to the list of icons returned from | 895 // default icon. The index is relative to the list of icons returned from |
896 // GetIcons. | 896 // GetIcons. |
897 int CookiesTreeModel::GetIconIndex(ui::TreeModelNode* node) { | 897 int CookiesTreeModel::GetIconIndex(ui::TreeModelNode* node) { |
898 CookieTreeNode* ct_node = static_cast<CookieTreeNode*>(node); | 898 CookieTreeNode* ct_node = static_cast<CookieTreeNode*>(node); |
899 switch (ct_node->GetDetailedInfo().node_type) { | 899 switch (ct_node->GetDetailedInfo().node_type) { |
900 case CookieTreeNode::DetailedInfo::TYPE_HOST: | 900 case CookieTreeNode::DetailedInfo::TYPE_HOST: |
901 return ORIGIN; | 901 return ORIGIN; |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1335 | 1335 |
1336 void CookiesTreeModel::NotifyObserverEndBatch() { | 1336 void CookiesTreeModel::NotifyObserverEndBatch() { |
1337 // Only notify the observers if this is the outermost call to EndBatch() if | 1337 // Only notify the observers if this is the outermost call to EndBatch() if |
1338 // called in a nested manner. | 1338 // called in a nested manner. |
1339 if (--batch_update_ == 0) { | 1339 if (--batch_update_ == 0) { |
1340 FOR_EACH_OBSERVER(Observer, | 1340 FOR_EACH_OBSERVER(Observer, |
1341 cookies_observer_list_, | 1341 cookies_observer_list_, |
1342 TreeModelEndBatch(this)); | 1342 TreeModelEndBatch(this)); |
1343 } | 1343 } |
1344 } | 1344 } |
OLD | NEW |