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

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: 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..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;
« 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