Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package


// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.


#include <vector>

#include "app/combobox_model.h"
#include "chrome/browser/bookmarks/bookmark_model.h"

// Model for the combobox showing the list of folders to choose from. The
// list always contains the bookmark bar, other node and parent. The list
// also contains an extra item that shows the text 'Choose another folder...'.
class RecentlyUsedFoldersComboModel : public ComboboxModel {
  RecentlyUsedFoldersComboModel(BookmarkModel* model, const BookmarkNode* node);

  // Overridden from ComboboxModel:
  virtual int GetItemCount();
  virtual std::wstring GetItemAt(int index);

  // Returns the node at the specified index.
  const BookmarkNode* GetNodeAt(int index);

  // Returns the index of the original parent folder.
  int node_parent_index() const { return node_parent_index_; }

  // Removes |node| from |nodes_|. Does nothing if |node| is not in |nodes_|.
  void RemoveNode(const BookmarkNode* node);

  std::vector<const BookmarkNode*> nodes_;
  int node_parent_index_;



Generated by  Doxygen 1.6.0   Back to index