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

Unified Diff: chrome/browser/ui/zoom/zoom_controller.cc

Issue 11040031: Fix zoom icon/bubble for virtual URLs (i.e. chrome://settings). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: doc Created 8 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a706ae94747f1c6e27d4e2f83da598f93885d0f8 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,8 +81,15 @@ 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;
+
+ // Use the active navigation entry's URL instead of the WebContents' so
+ // virtual URLs work (e.g. chrome://settings). http://crbug.com/153950
+ content::NavigationEntry* active_entry =
+ web_contents()->GetController().GetActiveEntry();
+ if (!active_entry ||
+ host != net::GetHostOrSpecFromURL(active_entry->GetURL())) {
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698