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

Side by Side Diff: ios/shared/chrome/browser/ui/browser_list/browser.h

Issue 2745223005: [ios] Adds a CommandDispatcher to Browser. (Closed)
Patch Set: Move code into ios/shared. 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_SHARED_CHROME_BROWSER_UI_BROWSER_LIST_BROWSER_H_ 5 #ifndef IOS_SHARED_CHROME_BROWSER_UI_BROWSER_LIST_BROWSER_H_
6 #define IOS_SHARED_CHROME_BROWSER_UI_BROWSER_LIST_BROWSER_H_ 6 #define IOS_SHARED_CHROME_BROWSER_UI_BROWSER_LIST_BROWSER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 11
12 class WebStateList; 12 class WebStateList;
13 class WebStateListDelegate; 13 class WebStateListDelegate;
14 14
15 @class CommandDispatcher;
16
15 namespace ios { 17 namespace ios {
16 class ChromeBrowserState; 18 class ChromeBrowserState;
17 } 19 }
18 20
19 // Browser holds the state backing a collection of Tabs and the attached 21 // Browser holds the state backing a collection of Tabs and the attached
20 // UI elements (Tab strip, ...). 22 // UI elements (Tab strip, ...).
21 class Browser { 23 class Browser {
22 public: 24 public:
23 explicit Browser(ios::ChromeBrowserState* browser_state); 25 explicit Browser(ios::ChromeBrowserState* browser_state);
24 ~Browser(); 26 ~Browser();
25 27
26 WebStateList& web_state_list() { return *web_state_list_.get(); } 28 WebStateList& web_state_list() { return *web_state_list_.get(); }
27 const WebStateList& web_state_list() const { return *web_state_list_.get(); } 29 const WebStateList& web_state_list() const { return *web_state_list_.get(); }
28 30
31 CommandDispatcher* dispatcher() { return dispatcher_; }
32
29 ios::ChromeBrowserState* browser_state() const { return browser_state_; } 33 ios::ChromeBrowserState* browser_state() const { return browser_state_; }
30 34
31 private: 35 private:
36 __strong CommandDispatcher* dispatcher_;
sdefresne 2017/03/24 09:10:19 We discussed having TabModel getting it's WebState
32 ios::ChromeBrowserState* browser_state_; 37 ios::ChromeBrowserState* browser_state_;
33 std::unique_ptr<WebStateListDelegate> web_state_list_delegate_; 38 std::unique_ptr<WebStateListDelegate> web_state_list_delegate_;
34 std::unique_ptr<WebStateList> web_state_list_; 39 std::unique_ptr<WebStateList> web_state_list_;
35 40
36 DISALLOW_COPY_AND_ASSIGN(Browser); 41 DISALLOW_COPY_AND_ASSIGN(Browser);
37 }; 42 };
38 43
39 #endif // IOS_SHARED_CHROME_BROWSER_UI_BROWSER_LIST_BROWSER_H_ 44 #endif // IOS_SHARED_CHROME_BROWSER_UI_BROWSER_LIST_BROWSER_H_
OLDNEW
« no previous file with comments | « ios/shared/chrome/browser/ui/browser_list/BUILD.gn ('k') | ios/shared/chrome/browser/ui/browser_list/browser.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698