summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/instant/instant_controller.cc6
-rw-r--r--chrome/browser/rlz/rlz.cc4
-rw-r--r--chrome/common/notification_type.h3
3 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index 24c70f8..d534cef 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -84,6 +85,11 @@ void InstantController::Update(TabContents* tab_contents,
} else {
ScheduleUpdate(match.destination_url);
}
+
+ NotificationService::current()->Notify(
+ NotificationType::INSTANT_CONTROLLER_UPDATED,
+ Source<InstantController>(this),
+ NotificationService::NoDetails());
}
void InstantController::SetOmniboxBounds(const gfx::Rect& bounds) {
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc
index 840ce60..2ba1ed0 100644
--- a/chrome/browser/rlz/rlz.cc
+++ b/chrome/browser/rlz/rlz.cc
@@ -66,6 +66,10 @@ class OmniBoxUsageObserver : public NotificationObserver {
OmniBoxUsageObserver() {
registrar_.Add(this, NotificationType::OMNIBOX_OPENED_URL,
NotificationService::AllSources());
+ // If instant is enabled we'll start searching as soon as the user starts
+ // typing in the omnibox (which triggers INSTANT_CONTROLLER_UPDATED).
+ registrar_.Add(this, NotificationType::INSTANT_CONTROLLER_UPDATED,
+ NotificationService::AllSources());
omnibox_used_ = false;
DCHECK(!instance_);
instance_ = this;
diff --git a/chrome/common/notification_type.h b/chrome/common/notification_type.h
index 735de96..4fa44f2 100644
--- a/chrome/common/notification_type.h
+++ b/chrome/common/notification_type.h
@@ -1209,6 +1209,9 @@ class NotificationType {
// This is only sent from ChromeOS's TabCloseableStateWatcher.
TAB_CLOSEABLE_STATE_CHANGED,
+ // Sent each time the InstantController is updated.
+ INSTANT_CONTROLLER_UPDATED,
+
// Password Store ----------------------------------------------------------
// This notification is sent whenenever login entries stored in the password
// store are changed. The detail of this notification is a list of changes