diff options
author | wjmaclean <wjmaclean@chromium.org> | 2014-12-09 06:59:55 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-09 15:00:15 +0000 |
commit | 7f63c6b94ee1d470791c243c4941c55315416171 (patch) | |
tree | d831aa080ee31fa0df7fbc8c09dbb43a29e608b2 /extensions | |
parent | 3490213352d10c5fbf71e5d259343914d7c7d86a (diff) | |
download | chromium_src-7f63c6b94ee1d470791c243c4941c55315416171.zip chromium_src-7f63c6b94ee1d470791c243c4941c55315416171.tar.gz chromium_src-7f63c6b94ee1d470791c243c4941c55315416171.tar.bz2 |
Move ZoomObserver, ZoomController and ZoomEventManager to components/.
This CL moves the three classes into components, namespace ui_zoom, and moves
their associated source files into components/ui/zoom so that
they can be used in non-chrome configurations.
BUG=none
TBR=willchan@chromium.org chrome/browser/profiles
TBR=fsamuel@chromium.org */web_view/*
TBR=estade@chromium.org chrome/browser/ui/autofill
TBR=pkasting@chromium.org chrome/browser/ui not covered above
TBR=dgozman@chromium.org chrome/browser/devtools
TBR=rsesek@chromium.org chrome/browser/browser_commands_unittest.cc
TBR=sky@chromium.org chrome/browser/renderer_preferences_util.cc
Review URL: https://codereview.chromium.org/769593003
Cr-Commit-Position: refs/heads/master@{#307470}
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/browser/BUILD.gn | 2 | ||||
-rw-r--r-- | extensions/browser/DEPS | 1 | ||||
-rw-r--r-- | extensions/browser/extension_zoom_request_client.cc | 17 | ||||
-rw-r--r-- | extensions/browser/extension_zoom_request_client.h | 35 | ||||
-rw-r--r-- | extensions/extensions.gyp | 2 |
5 files changed, 57 insertions, 0 deletions
diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn index 5ac0839..840dc4f 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn @@ -353,6 +353,8 @@ source_set("browser") { "extension_util.h", "extension_web_contents_observer.cc", "extension_web_contents_observer.h", + "extension_zoom_request_client.cc", + "extension_zoom_request_client.h", "extensions_browser_client.cc", "extensions_browser_client.h", "external_provider_interface.h", diff --git a/extensions/browser/DEPS b/extensions/browser/DEPS index d2863e2..ca34eba 100644 --- a/extensions/browser/DEPS +++ b/extensions/browser/DEPS @@ -4,6 +4,7 @@ include_rules = [ "+components/pref_registry", "+components/sessions", "+components/storage_monitor", + "+components/ui/zoom", "+components/web_cache", "+components/web_modal", "+content/public/browser", diff --git a/extensions/browser/extension_zoom_request_client.cc b/extensions/browser/extension_zoom_request_client.cc new file mode 100644 index 0000000..c954532 --- /dev/null +++ b/extensions/browser/extension_zoom_request_client.cc @@ -0,0 +1,17 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "extensions/browser/extension_zoom_request_client.h" + +namespace extensions { + +ExtensionZoomRequestClient::ExtensionZoomRequestClient( + scoped_refptr<const Extension> extension) + : extension_(extension) { +} + +ExtensionZoomRequestClient::~ExtensionZoomRequestClient() { +} + +} // namespace Extensions diff --git a/extensions/browser/extension_zoom_request_client.h b/extensions/browser/extension_zoom_request_client.h new file mode 100644 index 0000000..25d2196 --- /dev/null +++ b/extensions/browser/extension_zoom_request_client.h @@ -0,0 +1,35 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EXTENSIONS_BROWSER_EXTENSION_ZOOM_REQUEST_CLIENT_H_ +#define EXTENSIONS_BROWSER_EXTENSION_ZOOM_REQUEST_CLIENT_H_ + +#include "base/memory/scoped_ptr.h" +#include "components/ui/zoom/zoom_controller.h" +#include "extensions/common/extension.h" + +namespace extensions { + +class Extension; + +// This class implements ZoomRequestClient in order to encapsulate a ref pointer +// back to an extension requesting a zoom level change. This is important so +// that zoom event observers can determine if an extension made the request +// as opposed to direct user input. +class ExtensionZoomRequestClient : public ui_zoom::ZoomRequestClient { + public: + explicit ExtensionZoomRequestClient(scoped_refptr<const Extension> extension); + + const Extension* extension() const { return extension_.get(); } + + private: + ~ExtensionZoomRequestClient() override; + scoped_refptr<const Extension> extension_; + + DISALLOW_COPY_AND_ASSIGN(ExtensionZoomRequestClient); +}; + +} // namespace extensions + +#endif // EXTENSIONS_BROWSER_EXTENSION_ZOOM_REQUEST_CLIENT_H_ diff --git a/extensions/extensions.gyp b/extensions/extensions.gyp index 5caf113..31414e4 100644 --- a/extensions/extensions.gyp +++ b/extensions/extensions.gyp @@ -635,6 +635,8 @@ 'browser/extension_util.h', 'browser/extension_web_contents_observer.cc', 'browser/extension_web_contents_observer.h', + 'browser/extension_zoom_request_client.cc', + 'browser/extension_zoom_request_client.h', 'browser/extensions_browser_client.cc', 'browser/extensions_browser_client.h', 'browser/external_provider_interface.h', |