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

Side by Side Diff: ios/clean/chrome/browser/model/browser.h

Issue 2748793002: [ios] Add a delegate to WebStateList class. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 IOS_CLEAN_CHROME_BROWSER_MODEL_BROWSER_H_ 5 #ifndef IOS_CLEAN_CHROME_BROWSER_MODEL_BROWSER_H_
6 #define IOS_CLEAN_CHROME_BROWSER_MODEL_BROWSER_H_ 6 #define IOS_CLEAN_CHROME_BROWSER_MODEL_BROWSER_H_
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "ios/shared/chrome/browser/tabs/web_state_list.h" 11
12 class WebStateList;
13 class WebStateListDelegate;
10 14
11 namespace ios { 15 namespace ios {
12 class ChromeBrowserState; 16 class ChromeBrowserState;
13 } 17 }
14 18
15 // Browser holds the state backing a collection of Tabs and the attached 19 // Browser holds the state backing a collection of Tabs and the attached
16 // UI elements (Tab strip, ...). 20 // UI elements (Tab strip, ...).
17 class Browser { 21 class Browser {
18 public: 22 public:
19 explicit Browser(ios::ChromeBrowserState* browser_state); 23 Browser(ios::ChromeBrowserState* browser_state,
24 WebStateListDelegate* web_state_list_delegate);
rohitrao (ping after 24h) 2017/03/14 11:51:11 Why is this owned by the BrowserList and passed in
20 ~Browser(); 25 ~Browser();
21 26
22 WebStateList& web_state_list() { return web_state_list_; } 27 WebStateList* web_state_list() { return web_state_list_.get(); }
23 const WebStateList& web_state_list() const { return web_state_list_; } 28 const WebStateList* web_state_list() const { return web_state_list_.get(); }
24 29
25 ios::ChromeBrowserState* browser_state() const { return browser_state_; } 30 ios::ChromeBrowserState* browser_state() const { return browser_state_; }
26 31
27 private: 32 private:
28 WebStateList web_state_list_;
29 ios::ChromeBrowserState* browser_state_; 33 ios::ChromeBrowserState* browser_state_;
34 std::unique_ptr<WebStateList> web_state_list_;
30 35
31 DISALLOW_COPY_AND_ASSIGN(Browser); 36 DISALLOW_COPY_AND_ASSIGN(Browser);
32 }; 37 };
33 38
34 #endif // IOS_CLEAN_CHROME_BROWSER_MODEL_BROWSER_H_ 39 #endif // IOS_CLEAN_CHROME_BROWSER_MODEL_BROWSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698