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/tab_capture/tab_capture_registry.h" | 5 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/sessions/session_id.h" | 9 #include "chrome/browser/sessions/session_tab_helper.h" |
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
12 #include "content/public/browser/render_frame_host.h" | 12 #include "content/public/browser/render_frame_host.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
15 #include "extensions/browser/event_router.h" | 15 #include "extensions/browser/event_router.h" |
16 #include "extensions/browser/extension_registry.h" | 16 #include "extensions/browser/extension_registry.h" |
17 #include "extensions/common/extension.h" | 17 #include "extensions/common/extension.h" |
18 | 18 |
19 using content::BrowserThread; | 19 using content::BrowserThread; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // requested, so return early to avoid duplicate dispatching of status | 86 // requested, so return early to avoid duplicate dispatching of status |
87 // change events. | 87 // change events. |
88 if (capture_state_ == next_capture_state) | 88 if (capture_state_ == next_capture_state) |
89 return; | 89 return; |
90 | 90 |
91 capture_state_ = next_capture_state; | 91 capture_state_ = next_capture_state; |
92 registry_->DispatchStatusChangeEvent(this); | 92 registry_->DispatchStatusChangeEvent(this); |
93 } | 93 } |
94 | 94 |
95 void GetCaptureInfo(tab_capture::CaptureInfo* info) const { | 95 void GetCaptureInfo(tab_capture::CaptureInfo* info) const { |
96 info->tab_id = SessionID::IdForTab(web_contents()); | 96 info->tab_id = SessionTabHelper::IdForTab(web_contents()); |
97 info->status = capture_state_; | 97 info->status = capture_state_; |
98 info->fullscreen = is_fullscreened_; | 98 info->fullscreen = is_fullscreened_; |
99 } | 99 } |
100 | 100 |
101 protected: | 101 protected: |
102 virtual void DidShowFullscreenWidget(int routing_id) OVERRIDE { | 102 virtual void DidShowFullscreenWidget(int routing_id) OVERRIDE { |
103 is_fullscreened_ = true; | 103 is_fullscreened_ = true; |
104 if (capture_state_ == tab_capture::TAB_CAPTURE_STATE_ACTIVE) | 104 if (capture_state_ == tab_capture::TAB_CAPTURE_STATE_ACTIVE) |
105 registry_->DispatchStatusChangeEvent(this); | 105 registry_->DispatchStatusChangeEvent(this); |
106 } | 106 } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 it != requests_.end(); ++it) { | 351 it != requests_.end(); ++it) { |
352 if ((*it) == request) { | 352 if ((*it) == request) { |
353 requests_.erase(it); | 353 requests_.erase(it); |
354 return; | 354 return; |
355 } | 355 } |
356 } | 356 } |
357 NOTREACHED(); | 357 NOTREACHED(); |
358 } | 358 } |
359 | 359 |
360 } // namespace extensions | 360 } // namespace extensions |
OLD | NEW |