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_ANDROID_TAB_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
6 #define CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ | 6 #define CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/jni_helper.h" | 10 #include "base/android/jni_helper.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 // Return the WebContents, if any, currently owned by this TabAndroid. | 54 // Return the WebContents, if any, currently owned by this TabAndroid. |
55 content::WebContents* web_contents() const { return web_contents_.get(); } | 55 content::WebContents* web_contents() const { return web_contents_.get(); } |
56 | 56 |
57 // Return specific id information regarding this TabAndroid. | 57 // Return specific id information regarding this TabAndroid. |
58 const SessionID& session_id() const { return session_tab_id_; } | 58 const SessionID& session_id() const { return session_tab_id_; } |
59 int GetAndroidId() const; | 59 int GetAndroidId() const; |
60 int GetSyncId() const; | 60 int GetSyncId() const; |
61 | 61 |
62 // Return the tab title. | 62 // Return the tab title. |
63 string16 GetTitle() const; | 63 base::string16 GetTitle() const; |
64 | 64 |
65 // Return the tab url. | 65 // Return the tab url. |
66 GURL GetURL() const; | 66 GURL GetURL() const; |
67 | 67 |
68 // Restore the tab if it was unloaded from memory. | 68 // Restore the tab if it was unloaded from memory. |
69 bool RestoreIfNeeded(); | 69 bool RestoreIfNeeded(); |
70 | 70 |
71 // Helper methods to make it easier to access objects from the associated | 71 // Helper methods to make it easier to access objects from the associated |
72 // WebContents. Can return NULL. | 72 // WebContents. Can return NULL. |
73 content::ContentViewCore* GetContentViewCore() const; | 73 content::ContentViewCore* GetContentViewCore() const; |
74 Profile* GetProfile() const; | 74 Profile* GetProfile() const; |
75 browser_sync::SyncedTabDelegate* GetSyncedTabDelegate() const; | 75 browser_sync::SyncedTabDelegate* GetSyncedTabDelegate() const; |
76 | 76 |
77 void SetSyncId(int sync_id); | 77 void SetSyncId(int sync_id); |
78 | 78 |
79 virtual void HandlePopupNavigation(chrome::NavigateParams* params) = 0; | 79 virtual void HandlePopupNavigation(chrome::NavigateParams* params) = 0; |
80 | 80 |
81 virtual void OnReceivedHttpAuthRequest(jobject auth_handler, | 81 virtual void OnReceivedHttpAuthRequest(jobject auth_handler, |
82 const string16& host, | 82 const base::string16& host, |
83 const string16& realm) = 0; | 83 const base::string16& realm) = 0; |
84 | 84 |
85 // Called to show the regular context menu that is triggered by a long press. | 85 // Called to show the regular context menu that is triggered by a long press. |
86 virtual void ShowContextMenu(const content::ContextMenuParams& params) = 0; | 86 virtual void ShowContextMenu(const content::ContextMenuParams& params) = 0; |
87 | 87 |
88 // Called to show a custom context menu. Used by the NTP. | 88 // Called to show a custom context menu. Used by the NTP. |
89 virtual void ShowCustomContextMenu( | 89 virtual void ShowCustomContextMenu( |
90 const content::ContextMenuParams& params, | 90 const content::ContextMenuParams& params, |
91 const base::Callback<void(int)>& callback) = 0; | 91 const base::Callback<void(int)>& callback) = 0; |
92 | 92 |
93 // Called when context menu option to create the bookmark shortcut on | 93 // Called when context menu option to create the bookmark shortcut on |
94 // homescreen is called. | 94 // homescreen is called. |
95 virtual void AddShortcutToBookmark( | 95 virtual void AddShortcutToBookmark( |
96 const GURL& url, const string16& title, const SkBitmap& skbitmap, | 96 const GURL& url, const base::string16& title, const SkBitmap& skbitmap, |
97 int r_value, int g_value, int b_value) = 0; | 97 int r_value, int g_value, int b_value) = 0; |
98 | 98 |
99 // Called when a bookmark node should be edited. | 99 // Called when a bookmark node should be edited. |
100 virtual void EditBookmark(int64 node_id, | 100 virtual void EditBookmark(int64 node_id, |
101 const base::string16& node_title, | 101 const base::string16& node_title, |
102 bool is_folder, | 102 bool is_folder, |
103 bool is_partner_bookmark) = 0; | 103 bool is_partner_bookmark) = 0; |
104 | 104 |
105 // Called to determine if chrome://welcome should contain links to the terms | 105 // Called to determine if chrome://welcome should contain links to the terms |
106 // of service and the privacy notice. | 106 // of service and the privacy notice. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 scoped_ptr<content::WebContents> web_contents_; | 158 scoped_ptr<content::WebContents> web_contents_; |
159 scoped_ptr<chrome::android::ChromeWebContentsDelegateAndroid> | 159 scoped_ptr<chrome::android::ChromeWebContentsDelegateAndroid> |
160 web_contents_delegate_; | 160 web_contents_delegate_; |
161 | 161 |
162 scoped_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; | 162 scoped_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; |
163 | 163 |
164 DISALLOW_COPY_AND_ASSIGN(TabAndroid); | 164 DISALLOW_COPY_AND_ASSIGN(TabAndroid); |
165 }; | 165 }; |
166 | 166 |
167 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ | 167 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
OLD | NEW |