Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller.mm

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller.h"
6 6
7 #include "base/string16.h" 7 #include "base/string16.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "chrome/browser/bookmarks/bookmark_model.h" 9 #include "chrome/browser/bookmarks/bookmark_model.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/browser_tabstrip.h"
11 #include "chrome/browser/ui/cocoa/last_active_browser_cocoa.h" 12 #include "chrome/browser/ui/cocoa/last_active_browser_cocoa.h"
12 #include "chrome/browser/ui/tab_contents/tab_contents.h" 13 #include "chrome/browser/ui/tab_contents/tab_contents.h"
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" 14 #include "chrome/browser/ui/tabs/tab_strip_model.h"
14 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
15 #include "grit/generated_resources.h" 16 #include "grit/generated_resources.h"
16 #include "ui/base/l10n/l10n_util_mac.h" 17 #include "ui/base/l10n/l10n_util_mac.h"
17 18
18 using content::WebContents; 19 using content::WebContents;
19 20
20 @implementation BookmarkAllTabsController 21 @implementation BookmarkAllTabsController
(...skipping 22 matching lines...) Expand all
43 [super awakeFromNib]; 44 [super awakeFromNib];
44 } 45 }
45 46
46 #pragma mark Bookmark Editing 47 #pragma mark Bookmark Editing
47 48
48 - (void)UpdateActiveTabPairs { 49 - (void)UpdateActiveTabPairs {
49 activeTabPairsVector_.clear(); 50 activeTabPairsVector_.clear();
50 Browser* browser = browser::GetLastActiveBrowser(); 51 Browser* browser = browser::GetLastActiveBrowser();
51 const int tabCount = browser->tab_count(); 52 const int tabCount = browser->tab_count();
52 for (int i = 0; i < tabCount; ++i) { 53 for (int i = 0; i < tabCount; ++i) {
53 WebContents* contents = browser->GetWebContentsAt(i); 54 WebContents* contents = chrome::GetWebContentsAt(browser, i);
54 ActiveTabNameURLPair tabPair(contents->GetTitle(), contents->GetURL()); 55 ActiveTabNameURLPair tabPair(contents->GetTitle(), contents->GetURL());
55 activeTabPairsVector_.push_back(tabPair); 56 activeTabPairsVector_.push_back(tabPair);
56 } 57 }
57 } 58 }
58 59
59 // Called by -[BookmarkEditorBaseController ok:]. Creates the container 60 // Called by -[BookmarkEditorBaseController ok:]. Creates the container
60 // folder for the tabs and then the bookmarks in that new folder. 61 // folder for the tabs and then the bookmarks in that new folder.
61 // Returns a BOOL as an NSNumber indicating that the commit may proceed. 62 // Returns a BOOL as an NSNumber indicating that the commit may proceed.
62 - (NSNumber*)didCommit { 63 - (NSNumber*)didCommit {
63 const BookmarkNode* newParentNode = [self selectedNode]; 64 const BookmarkNode* newParentNode = [self selectedNode];
(...skipping 17 matching lines...) Expand all
81 } 82 }
82 return [NSNumber numberWithBool:YES]; 83 return [NSNumber numberWithBool:YES];
83 } 84 }
84 85
85 - (ActiveTabsNameURLPairVector*)activeTabPairsVector { 86 - (ActiveTabsNameURLPairVector*)activeTabPairsVector {
86 return &activeTabPairsVector_; 87 return &activeTabPairsVector_;
87 } 88 }
88 89
89 @end // BookmarkAllTabsController 90 @end // BookmarkAllTabsController
90 91
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698