• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_ALL_TABS_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_ALL_TABS_CONTROLLER_H_
7 #pragma once
8 
9 #include <utility>
10 #include <vector>
11 
12 #include "base/string16.h"
13 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h"
14 
15 // A list of pairs containing the name and URL associated with each
16 // currently active tab in the active browser window.
17 typedef std::pair<string16, GURL> ActiveTabNameURLPair;
18 typedef std::vector<ActiveTabNameURLPair> ActiveTabsNameURLPairVector;
19 
20 // A controller for the Bookmark All Tabs sheet which is presented upon
21 // selecting the Bookmark All Tabs... menu item shown by the contextual
22 // menu in the bookmarks bar.
23 @interface BookmarkAllTabsController : BookmarkEditorBaseController {
24  @private
25   ActiveTabsNameURLPairVector activeTabPairsVector_;
26 }
27 
28 - (id)initWithParentWindow:(NSWindow*)parentWindow
29                    profile:(Profile*)profile
30                     parent:(const BookmarkNode*)parent
31              configuration:(BookmarkEditor::Configuration)configuration;
32 
33 @end
34 
35 @interface BookmarkAllTabsController(TestingAPI)
36 
37 // Initializes the list of all tab names and URLs.  Overridden by unit test
38 // to provide canned test data.
39 - (void)UpdateActiveTabPairs;
40 
41 // Provides testing access to tab pairs list.
42 - (ActiveTabsNameURLPairVector*)activeTabPairsVector;
43 
44 @end
45 
46 #endif  // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_ALL_TABS_CONTROLLER_H_
47