| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SERVICE_TAB_LAUNCHER_H_ | 5 #ifndef COMPONENTS_SERVICE_TAB_LAUNCHER_BROWSER_ANDROID_SERVICE_TAB_LAUNCHER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_SERVICE_TAB_LAUNCHER_H_ | 6 #define COMPONENTS_SERVICE_TAB_LAUNCHER_BROWSER_ANDROID_SERVICE_TAB_LAUNCHER_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class BrowserContext; | 14 class BrowserContext; |
| 15 struct OpenURLParams; | 15 struct OpenURLParams; |
| 16 class WebContents; | 16 class WebContents; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace chrome { | 19 namespace service_tab_launcher { |
| 20 namespace android { | |
| 21 | 20 |
| 22 // Launcher for creating new tabs on Android from a background service, where | 21 // Launcher for creating new tabs on Android from a background service, where |
| 23 // there may not necessarily be an Activity or a tab model at all. When the | 22 // there may not necessarily be an Activity or a tab model at all. When the |
| 24 // tab has been launched, the user of this class will be informed with the | 23 // tab has been launched, the user of this class will be informed with the |
| 25 // content::WebContents instance associated with the tab. | 24 // content::WebContents instance associated with the tab. |
| 26 class ServiceTabLauncher { | 25 class ServiceTabLauncher { |
| 27 using TabLaunchedCallback = base::Callback<void(content::WebContents*)>; | 26 using TabLaunchedCallback = base::Callback<void(content::WebContents*)>; |
| 28 | 27 |
| 29 public: | 28 public: |
| 30 // Returns the singleton instance of the service tab launcher. | 29 // Returns the singleton instance of the service tab launcher. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 50 ServiceTabLauncher(); | 49 ServiceTabLauncher(); |
| 51 ~ServiceTabLauncher(); | 50 ~ServiceTabLauncher(); |
| 52 | 51 |
| 53 IDMap<TabLaunchedCallback> tab_launched_callbacks_; | 52 IDMap<TabLaunchedCallback> tab_launched_callbacks_; |
| 54 | 53 |
| 55 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 54 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 56 | 55 |
| 57 DISALLOW_COPY_AND_ASSIGN(ServiceTabLauncher); | 56 DISALLOW_COPY_AND_ASSIGN(ServiceTabLauncher); |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 } // namespace android | 59 } // namespace service_tab_launcher |
| 61 } // namespace chrome | |
| 62 | 60 |
| 63 #endif // CHROME_BROWSER_ANDROID_SERVICE_TAB_LAUNCHER_H_ | 61 #endif // COMPONENTS_SERVICE_TAB_LAUNCHER_BROWSER_ANDROID_SERVICE_TAB_LAUNCHER_
H_ |
| OLD | NEW |