| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 registry_->DispatchStatusChangeEvent(this); | 97 registry_->DispatchStatusChangeEvent(this); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void GetCaptureInfo(tab_capture::CaptureInfo* info) const { | 100 void GetCaptureInfo(tab_capture::CaptureInfo* info) const { |
| 101 info->tab_id = SessionTabHelper::IdForTab(web_contents()); | 101 info->tab_id = SessionTabHelper::IdForTab(web_contents()); |
| 102 info->status = capture_state_; | 102 info->status = capture_state_; |
| 103 info->fullscreen = is_fullscreened_; | 103 info->fullscreen = is_fullscreened_; |
| 104 } | 104 } |
| 105 | 105 |
| 106 protected: | 106 protected: |
| 107 void DidShowFullscreenWidget(int routing_id) override { | 107 void DidShowFullscreenWidget() override { |
| 108 is_fullscreened_ = true; | 108 is_fullscreened_ = true; |
| 109 if (capture_state_ == tab_capture::TAB_CAPTURE_STATE_ACTIVE) | 109 if (capture_state_ == tab_capture::TAB_CAPTURE_STATE_ACTIVE) |
| 110 registry_->DispatchStatusChangeEvent(this); | 110 registry_->DispatchStatusChangeEvent(this); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void DidDestroyFullscreenWidget(int routing_id) override { | 113 void DidDestroyFullscreenWidget() override { |
| 114 is_fullscreened_ = false; | 114 is_fullscreened_ = false; |
| 115 if (capture_state_ == tab_capture::TAB_CAPTURE_STATE_ACTIVE) | 115 if (capture_state_ == tab_capture::TAB_CAPTURE_STATE_ACTIVE) |
| 116 registry_->DispatchStatusChangeEvent(this); | 116 registry_->DispatchStatusChangeEvent(this); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void DidToggleFullscreenModeForTab(bool entered_fullscreen, | 119 void DidToggleFullscreenModeForTab(bool entered_fullscreen, |
| 120 bool will_cause_resize) override { | 120 bool will_cause_resize) override { |
| 121 is_fullscreened_ = entered_fullscreen; | 121 is_fullscreened_ = entered_fullscreen; |
| 122 if (capture_state_ == tab_capture::TAB_CAPTURE_STATE_ACTIVE) | 122 if (capture_state_ == tab_capture::TAB_CAPTURE_STATE_ACTIVE) |
| 123 registry_->DispatchStatusChangeEvent(this); | 123 registry_->DispatchStatusChangeEvent(this); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 it != requests_.end(); ++it) { | 364 it != requests_.end(); ++it) { |
| 365 if ((*it) == request) { | 365 if ((*it) == request) { |
| 366 requests_.erase(it); | 366 requests_.erase(it); |
| 367 return; | 367 return; |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 NOTREACHED(); | 370 NOTREACHED(); |
| 371 } | 371 } |
| 372 | 372 |
| 373 } // namespace extensions | 373 } // namespace extensions |
| OLD | NEW |