Index: chrome/browser/ui/zoom/zoom_controller.cc |
diff --git a/chrome/browser/ui/zoom/zoom_controller.cc b/chrome/browser/ui/zoom/zoom_controller.cc |
index 66ba5ee0c28367a78c80820e7291dc9978347163..b25f71aff110a3c034985a662ba892737fcebf22 100644 |
--- a/chrome/browser/ui/zoom/zoom_controller.cc |
+++ b/chrome/browser/ui/zoom/zoom_controller.cc |
@@ -11,6 +11,7 @@ |
#include "chrome/common/chrome_notification_types.h" |
#include "chrome/common/pref_names.h" |
#include "content/public/browser/host_zoom_map.h" |
+#include "content/public/browser/navigation_entry.h" |
#include "content/public/browser/notification_types.h" |
#include "content/public/browser/notification_details.h" |
#include "content/public/browser/notification_service.h" |
@@ -80,9 +81,20 @@ void ZoomController::Observe(int type, |
} |
void ZoomController::UpdateState(const std::string& host) { |
- if (!host.empty() && |
- host != net::GetHostOrSpecFromURL(web_contents()->GetURL())) { |
+ if (host.empty()) |
return; |
+ |
+ content::NavigationEntry* active_entry = |
+ web_contents()->GetController().GetActiveEntry(); |
+ if (active_entry) { |
+ // Prefer to ask the navigation controller for the non-virtual URL. |
sky
2012/10/04 16:01:12
Document why we need to do this.
Dan Beam
2012/10/04 16:03:11
Is the explanation a couple lines below sufficient
Dan Beam
2012/10/04 19:05:42
OK, so I added a comment in the newest version wit
|
+ if (host != net::GetHostOrSpecFromURL(active_entry->GetURL())) |
+ return; |
+ } else { |
Kyle Horimoto
2012/10/04 03:00:22
When exactly is active_entry NULL? A little confus
Dan Beam
2012/10/04 03:13:04
http://code.google.com/searchframe#OAMlx_jo-ck/src
|
+ // If that's not available, just ask the web contents (doesn't work on pages |
+ // with virtual URLs, e.g. chrome://settings). |
+ if (host != net::GetHostOrSpecFromURL(web_contents()->GetURL())) |
+ return; |
} |
bool dummy; |