OLD | NEW |
---|---|
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_ANDROID_TAB_MODEL_TAB_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_ |
6 #define CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/sync/glue/synced_window_delegate.h" | 9 #include "chrome/browser/sync/glue/synced_window_delegate.h" |
10 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 10 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 | 49 |
50 // Used by Developer Tools to create a new tab with a given URL. | 50 // Used by Developer Tools to create a new tab with a given URL. |
51 // Replaces CreateTabForTesting. | 51 // Replaces CreateTabForTesting. |
52 virtual content::WebContents* CreateNewTabForDevTools(const GURL& url) = 0; | 52 virtual content::WebContents* CreateNewTabForDevTools(const GURL& url) = 0; |
53 | 53 |
54 // Return true if we are currently restoring sessions asynchronously. | 54 // Return true if we are currently restoring sessions asynchronously. |
55 virtual bool IsSessionRestoreInProgress() const = 0; | 55 virtual bool IsSessionRestoreInProgress() const = 0; |
56 | 56 |
57 protected: | 57 protected: |
58 explicit TabModel(Profile* profile); | 58 explicit TabModel(Profile* profile); |
59 virtual ~TabModel(); | 59 ~TabModel() override; |
msw
2014/10/21 19:36:11
Why does this seem to operate contrary to the Goog
dcheng
2014/10/21 20:14:53
From http://google-styleguide.googlecode.com/svn/t
| |
60 | 60 |
61 // Instructs the TabModel to broadcast a notification that all tabs are now | 61 // Instructs the TabModel to broadcast a notification that all tabs are now |
62 // loaded from storage. | 62 // loaded from storage. |
63 void BroadcastSessionRestoreComplete(); | 63 void BroadcastSessionRestoreComplete(); |
64 | 64 |
65 ToolbarModel* GetToolbarModel(); | 65 ToolbarModel* GetToolbarModel(); |
66 | 66 |
67 private: | 67 private: |
68 // Determines how TabModel will interact with the profile. | 68 // Determines how TabModel will interact with the profile. |
69 virtual void Observe(int type, | 69 void Observe(int type, |
msw
2014/10/21 19:36:11
I guess this is implementing the following policy?
dcheng
2014/10/21 20:14:53
Yep.
| |
70 const content::NotificationSource& source, | 70 const content::NotificationSource& source, |
71 const content::NotificationDetails& details) override; | 71 const content::NotificationDetails& details) override; |
72 | 72 |
73 // The profile associated with this TabModel. | 73 // The profile associated with this TabModel. |
74 Profile* profile_; | 74 Profile* profile_; |
75 | 75 |
76 // Describes if this TabModel contains an off-the-record profile. | 76 // Describes if this TabModel contains an off-the-record profile. |
77 bool is_off_the_record_; | 77 bool is_off_the_record_; |
78 | 78 |
79 // The SyncedWindowDelegate associated with this TabModel. | 79 // The SyncedWindowDelegate associated with this TabModel. |
80 scoped_ptr<browser_sync::SyncedWindowDelegateAndroid> synced_window_delegate_; | 80 scoped_ptr<browser_sync::SyncedWindowDelegateAndroid> synced_window_delegate_; |
81 | 81 |
82 // Unique identifier of this TabModel for session restore. This id is only | 82 // Unique identifier of this TabModel for session restore. This id is only |
83 // unique within the current session, and is not guaranteed to be unique | 83 // unique within the current session, and is not guaranteed to be unique |
84 // across sessions. | 84 // across sessions. |
85 SessionID session_id_; | 85 SessionID session_id_; |
86 | 86 |
87 // The Registrar used to register TabModel for notifications. | 87 // The Registrar used to register TabModel for notifications. |
88 content::NotificationRegistrar registrar_; | 88 content::NotificationRegistrar registrar_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(TabModel); | 90 DISALLOW_COPY_AND_ASSIGN(TabModel); |
91 }; | 91 }; |
92 | 92 |
93 #endif // CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_ | 93 #endif // CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_ |
OLD | NEW |