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

Side by Side Diff: chrome/browser/ui/tabs/tab_strip_model.h

Issue 2411113003: Remove stl_util's deletion functions from tab_strip_model, and do other modernization. (Closed)
Patch Set: {} Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/ui/tabs/tab_strip_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_ 5 #ifndef CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_
6 #define CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_ 6 #define CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 int to_position, 511 int to_position,
512 bool select_after_move); 512 bool select_after_move);
513 513
514 // Implementation of MoveSelectedTabsTo. Moves |length| of the selected tabs 514 // Implementation of MoveSelectedTabsTo. Moves |length| of the selected tabs
515 // starting at |start| to |index|. See MoveSelectedTabsTo for more details. 515 // starting at |start| to |index|. See MoveSelectedTabsTo for more details.
516 void MoveSelectedTabsToImpl(int index, size_t start, size_t length); 516 void MoveSelectedTabsToImpl(int index, size_t start, size_t length);
517 517
518 // Returns true if the tab represented by the specified data has an opener 518 // Returns true if the tab represented by the specified data has an opener
519 // that matches the specified one. If |use_group| is true, then this will 519 // that matches the specified one. If |use_group| is true, then this will
520 // fall back to check the group relationship as well. 520 // fall back to check the group relationship as well.
521 static bool OpenerMatches(const WebContentsData* data, 521 static bool OpenerMatches(const std::unique_ptr<WebContentsData>& data,
522 const content::WebContents* opener, 522 const content::WebContents* opener,
523 bool use_group); 523 bool use_group);
524 524
525 // Sets the group/opener of any tabs that reference the tab at |index| to that 525 // Sets the group/opener of any tabs that reference the tab at |index| to that
526 // tab's group/opener respectively. 526 // tab's group/opener respectively.
527 void FixOpenersAndGroupsReferencing(int index); 527 void FixOpenersAndGroupsReferencing(int index);
528 528
529 // Our delegate. 529 // Our delegate.
530 TabStripModelDelegate* delegate_; 530 TabStripModelDelegate* delegate_;
531 531
532 // The WebContents data currently hosted within this TabStripModel. 532 // The WebContents data currently hosted within this TabStripModel.
533 typedef std::vector<WebContentsData*> WebContentsDataVector; 533 std::vector<std::unique_ptr<WebContentsData>> contents_data_;
534 WebContentsDataVector contents_data_;
535 534
536 // A profile associated with this TabStripModel. 535 // A profile associated with this TabStripModel.
537 Profile* profile_; 536 Profile* profile_;
538 537
539 // True if all tabs are currently being closed via CloseAllTabs. 538 // True if all tabs are currently being closed via CloseAllTabs.
540 bool closing_all_; 539 bool closing_all_;
541 540
542 // An object that determines where new Tabs should be inserted and where 541 // An object that determines where new Tabs should be inserted and where
543 // selection should move when a Tab is closed. 542 // selection should move when a Tab is closed.
544 std::unique_ptr<TabStripModelOrderController> order_controller_; 543 std::unique_ptr<TabStripModelOrderController> order_controller_;
545 544
546 // Our observers. 545 // Our observers.
547 typedef base::ObserverList<TabStripModelObserver> TabStripModelObservers; 546 base::ObserverList<TabStripModelObserver> observers_;
548 TabStripModelObservers observers_;
549 547
550 ui::ListSelectionModel selection_model_; 548 ui::ListSelectionModel selection_model_;
551 549
552 // TODO(sky): remove this; used for debugging 291265. 550 // TODO(sky): remove this; used for debugging 291265.
553 bool in_notify_; 551 bool in_notify_;
554 552
555 base::WeakPtrFactory<TabStripModel> weak_factory_; 553 base::WeakPtrFactory<TabStripModel> weak_factory_;
556 554
557 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel); 555 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel);
558 }; 556 };
559 557
560 #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_ 558 #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/tabs/tab_strip_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698