Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Unified Diff: chrome/browser/ui/tabs/tab_strip_model.cc

Issue 2630583002: Add setting to isolate zoom changes by default. (Closed)
Patch Set: ... and tell closure_compiler. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/tabs/tab_strip_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tabs/tab_strip_model.cc
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc
index 737b80928761843e6208a44f179f180653d14358..1aebba7279140ab69321f1c0de7171a0d479c481 100644
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/ui/web_contents_sizer.h"
#include "chrome/common/url_constants.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
+#include "components/zoom/zoom_controller.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
@@ -342,6 +343,13 @@ WebContents* TabStripModel::ReplaceWebContentsAt(int index,
contents_data_[index]->SetWebContents(new_contents);
+ // Notify the ZoomController of the replacement of its WebContents so that it
+ // may clone any per-tab zoom information.
+ zoom::ZoomController* zoom_controller =
+ zoom::ZoomController::FromWebContents(old_contents);
+ if (zoom_controller)
+ zoom_controller->WebContentsReplaced(new_contents);
+
for (auto& observer : observers_)
observer.TabReplacedAt(this, old_contents, new_contents, index);
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/tabs/tab_strip_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698