| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_EXTENSION_ZOOM_REQUEST_CLIENT_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_ZOOM_REQUEST_CLIENT_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_ZOOM_REQUEST_CLIENT_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_ZOOM_REQUEST_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/ui/zoom/zoom_controller.h" | 11 #include "components/zoom/zoom_controller.h" |
| 12 #include "extensions/common/extension.h" | 12 #include "extensions/common/extension.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 class Extension; | 16 class Extension; |
| 17 | 17 |
| 18 // This class implements ZoomRequestClient in order to encapsulate a ref pointer | 18 // This class implements ZoomRequestClient in order to encapsulate a ref pointer |
| 19 // back to an extension requesting a zoom level change. This is important so | 19 // back to an extension requesting a zoom level change. This is important so |
| 20 // that zoom event observers can determine if an extension made the request | 20 // that zoom event observers can determine if an extension made the request |
| 21 // as opposed to direct user input. | 21 // as opposed to direct user input. |
| 22 class ExtensionZoomRequestClient : public ui_zoom::ZoomRequestClient { | 22 class ExtensionZoomRequestClient : public zoom::ZoomRequestClient { |
| 23 public: | 23 public: |
| 24 explicit ExtensionZoomRequestClient(scoped_refptr<const Extension> extension); | 24 explicit ExtensionZoomRequestClient(scoped_refptr<const Extension> extension); |
| 25 | 25 |
| 26 bool ShouldSuppressBubble() const override; | 26 bool ShouldSuppressBubble() const override; |
| 27 const Extension* extension() const { return extension_.get(); } | 27 const Extension* extension() const { return extension_.get(); } |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 ~ExtensionZoomRequestClient() override; | 30 ~ExtensionZoomRequestClient() override; |
| 31 scoped_refptr<const Extension> extension_; | 31 scoped_refptr<const Extension> extension_; |
| 32 | 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(ExtensionZoomRequestClient); | 33 DISALLOW_COPY_AND_ASSIGN(ExtensionZoomRequestClient); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 } // namespace extensions | 36 } // namespace extensions |
| 37 | 37 |
| 38 #endif // EXTENSIONS_BROWSER_EXTENSION_ZOOM_REQUEST_CLIENT_H_ | 38 #endif // EXTENSIONS_BROWSER_EXTENSION_ZOOM_REQUEST_CLIENT_H_ |
| OLD | NEW |