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 #include "chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h" | 5 #include "chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/values.h" | 17 #include "base/values.h" |
18 #include "chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_constants.
h" | 18 #include "chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_constants.
h" |
19 #include "chrome/browser/extensions/api/tabs/tabs.h" | 19 #include "chrome/browser/extensions/api/tabs/tabs.h" |
20 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 20 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
21 #include "chrome/browser/extensions/extension_event_names.h" | 21 #include "chrome/browser/extensions/event_names.h" |
22 #include "chrome/browser/extensions/extension_event_router.h" | 22 #include "chrome/browser/extensions/event_router.h" |
23 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 23 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
24 #include "chrome/browser/extensions/extension_service.h" | 24 #include "chrome/browser/extensions/extension_service.h" |
25 #include "chrome/browser/extensions/extension_tab_util.h" | 25 #include "chrome/browser/extensions/extension_tab_util.h" |
26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
27 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
28 #include "chrome/browser/ui/browser_window.h" | 28 #include "chrome/browser/ui/browser_window.h" |
29 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 29 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
30 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 30 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
31 #include "chrome/common/chrome_notification_types.h" | 31 #include "chrome/common/chrome_notification_types.h" |
32 #include "chrome/common/extensions/extension.h" | 32 #include "chrome/common/extensions/extension.h" |
(...skipping 10 matching lines...) Expand all Loading... |
43 | 43 |
44 using content::NativeWebKeyboardEvent; | 44 using content::NativeWebKeyboardEvent; |
45 using content::NavigationController; | 45 using content::NavigationController; |
46 using content::NotificationDetails; | 46 using content::NotificationDetails; |
47 using content::NotificationSource; | 47 using content::NotificationSource; |
48 using content::WebContents; | 48 using content::WebContents; |
49 using WebKit::WebInputEvent; | 49 using WebKit::WebInputEvent; |
50 | 50 |
51 namespace keys = extensions::offscreen_tabs_constants; | 51 namespace keys = extensions::offscreen_tabs_constants; |
52 namespace tabs_keys = extensions::tabs_constants; | 52 namespace tabs_keys = extensions::tabs_constants; |
53 namespace events = extension_event_names; | 53 namespace events = extensions::event_names; |
54 | 54 |
55 namespace { | 55 namespace { |
56 | 56 |
57 class ParentTab; | 57 class ParentTab; |
58 | 58 |
59 // This class is responsible for the life cycle of an offscreen tab. | 59 // This class is responsible for the life cycle of an offscreen tab. |
60 class OffscreenTab : public content::NotificationObserver { | 60 class OffscreenTab : public content::NotificationObserver { |
61 public: | 61 public: |
62 OffscreenTab(); | 62 OffscreenTab(); |
63 virtual ~OffscreenTab(); | 63 virtual ~OffscreenTab(); |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 // async case (when a "javascript": URL is sent to a tab). | 832 // async case (when a "javascript": URL is sent to a tab). |
833 if (!is_async) | 833 if (!is_async) |
834 SendResponse(true); | 834 SendResponse(true); |
835 | 835 |
836 return true; | 836 return true; |
837 } | 837 } |
838 | 838 |
839 void UpdateOffscreenTabFunction::PopulateResult() { | 839 void UpdateOffscreenTabFunction::PopulateResult() { |
840 // There's no result associated with this callback. | 840 // There's no result associated with this callback. |
841 } | 841 } |
OLD | NEW |