refactor: remove redundant resizing strategy equality check (#38596)

* refactor: remove redundant resizing strategy equality check

Upstream already checks this.
This commit is contained in:
Charles Kerr 2023-06-06 14:03:39 -05:00 committed by GitHub
parent 7982c6cee2
commit 5c1321b20a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

View file

@ -21,6 +21,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/devtools/devtools_contents_resizing_strategy.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
@ -624,13 +625,8 @@ void InspectableWebContents::AddDevToolsExtensionsToClient() {
#endif
void InspectableWebContents::SetInspectedPageBounds(const gfx::Rect& rect) {
DevToolsContentsResizingStrategy strategy(rect);
if (contents_resizing_strategy_.Equals(strategy))
return;
contents_resizing_strategy_.CopyFrom(strategy);
if (managed_devtools_web_contents_)
view_->SetContentsResizingStrategy(contents_resizing_strategy_);
view_->SetContentsResizingStrategy(DevToolsContentsResizingStrategy{rect});
}
void InspectableWebContents::InspectElementCompleted() {}

View file

@ -10,15 +10,12 @@
#include <memory>
#include <set>
#include <string>
#include <vector>
#include "base/containers/span.h"
#include "base/containers/unique_ptr_adapters.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/devtools/devtools_contents_resizing_strategy.h"
#include "chrome/browser/devtools/devtools_embedder_message_dispatcher.h"
#include "chrome/browser/devtools/devtools_settings.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_frontend_host.h"
#include "content/public/browser/web_contents_delegate.h"
@ -202,7 +199,6 @@ class InspectableWebContents
void AddDevToolsExtensionsToClient();
#endif
DevToolsContentsResizingStrategy contents_resizing_strategy_;
gfx::Rect devtools_bounds_;
bool can_dock_ = true;
std::string dock_state_;