Commit 4bf34cee authored by edchin's avatar edchin

[ios] Remove dead snapshot size code

This CL simply removes unused/dead code from snapshots.

Change-Id: I23d7eebea71d1db42057b5b06750d76fc2081bd0
Reviewed-on: https://chromium-review.googlesource.com/c/1392265Reviewed-by: default avataredchin <edchin@chromium.org>
Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619566}
parent fe0e620b
......@@ -7,7 +7,6 @@
#import <UIKit/UIKit.h>
@class SnapshotOverlay;
@protocol SnapshotGeneratorDelegate;
namespace web {
......@@ -25,11 +24,6 @@ class WebState;
- (instancetype)init NS_UNAVAILABLE;
// Returns the size the snapshot for the current page would have if it
// was regenerated. If capturing the snapshot is not possible, returns
// CGSizeZero.
- (CGSize)snapshotSize;
// Gets a color snapshot for the current page, calling |callback| once it has
// been retrieved. Invokes |callback| with nil if a snapshot does not exist.
- (void)retrieveSnapshot:(void (^)(UIImage*))callback;
......
......@@ -15,14 +15,11 @@
#include "base/logging.h"
#include "base/task/post_task.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#import "ios/chrome/browser/ntp/new_tab_page_tab_helper.h"
#import "ios/chrome/browser/snapshots/snapshot_cache.h"
#import "ios/chrome/browser/snapshots/snapshot_cache_factory.h"
#import "ios/chrome/browser/snapshots/snapshot_generator_delegate.h"
#import "ios/chrome/browser/snapshots/snapshot_overlay.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#include "ios/web/public/features.h"
#import "ios/web/public/features.h"
#import "ios/web/public/web_state/web_state.h"
#import "ios/web/public/web_state/web_state_observer_bridge.h"
#include "ios/web/public/web_task_traits.h"
......@@ -81,10 +78,6 @@ BOOL ViewHierarchyContainsWKWebView(UIView* view) {
}
}
- (CGSize)snapshotSize {
return [self snapshotFrame].size;
}
- (void)retrieveSnapshot:(void (^)(UIImage*))callback {
DCHECK(callback);
if (self.snapshotCache) {
......
......@@ -5,21 +5,22 @@
#ifndef IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_TAB_HELPER_H_
#define IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_TAB_HELPER_H_
#include <memory>
#import <UIKit/UIKit.h>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/scoped_observer.h"
#include "components/infobars/core/infobar_manager.h"
#import "ios/web/public/web_state/web_state.h"
#include "ios/web/public/web_state/web_state_observer.h"
#import "ios/web/public/web_state/web_state_user_data.h"
@class SnapshotGenerator;
@protocol SnapshotGeneratorDelegate;
namespace web {
class WebState;
}
// SnapshotTabHelper allows capturing and retrival for web page snapshots.
class SnapshotTabHelper : public infobars::InfoBarManager::Observer,
public web::WebStateObserver,
......@@ -36,11 +37,6 @@ class SnapshotTabHelper : public infobars::InfoBarManager::Observer,
// results in failures. The delegate is not owned by the tab helper.
void SetDelegate(id<SnapshotGeneratorDelegate> delegate);
// Returns the size the snapshot for the current page would have if it
// was regenerated. If capturing the snapshot is not possible, returns
// CGSizeZero.
CGSize GetSnapshotSize() const;
// Retrieves a color snapshot for the current page, invoking |callback|
// with the image. The callback may be called synchronously is there is
// a cached snapshot available in memory, otherwise it will be invoked
......
......@@ -11,6 +11,7 @@
#include "ios/chrome/browser/infobars/infobar_manager_impl.h"
#import "ios/chrome/browser/snapshots/snapshot_generator.h"
#include "ios/chrome/browser/ui/util/ui_util.h"
#import "ios/web/public/web_state/web_state.h"
#include "ios/web/public/web_task_traits.h"
#include "ios/web/public/web_thread.h"
......@@ -55,10 +56,6 @@ void SnapshotTabHelper::SetDelegate(id<SnapshotGeneratorDelegate> delegate) {
snapshot_generator_.delegate = delegate;
}
CGSize SnapshotTabHelper::GetSnapshotSize() const {
return [snapshot_generator_ snapshotSize];
}
void SnapshotTabHelper::RetrieveColorSnapshot(void (^callback)(UIImage*)) {
[snapshot_generator_ retrieveSnapshot:callback];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment