summaryrefslogtreecommitdiffstats
path: root/chrome/browser/google/google_url_tracker.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-10 15:52:27 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-10 15:52:27 +0000
commit43211582b1fa8c69136385250e7b0446cf364b5c (patch)
tree655ab01543012b6fd5699dee8fab92876959b7d9 /chrome/browser/google/google_url_tracker.cc
parentd43970a7ceee5fc5433787b0f28b64234a4039f2 (diff)
downloadchromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.zip
chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.tar.gz
chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.tar.bz2
Moving notification types which are chrome specific to a new header file chrome_notification_types.h.
This file lives in chrome\common. The chrome specific notifications start from NOTIFICATION_CONTENT_END which defines the end of the enum used by content to define notification types. The notificaton_type.h file in content\common has been renamed to content_notification_types.h BUG=76698 Review URL: http://codereview.chromium.org/7327007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/google/google_url_tracker.cc')
-rw-r--r--chrome/browser/google/google_url_tracker.cc34
1 files changed, 18 insertions, 16 deletions
diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc
index b50d34c..ad87589 100644
--- a/chrome/browser/google/google_url_tracker.cc
+++ b/chrome/browser/google/google_url_tracker.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/navigation_controller.h"
@@ -257,9 +258,10 @@ void GoogleURLTracker::AcceptGoogleURL(const GURL& new_google_url) {
google_url_.spec());
g_browser_process->local_state()->SetString(prefs::kLastPromptedGoogleURL,
google_url_.spec());
- NotificationService::current()->Notify(NotificationType::GOOGLE_URL_UPDATED,
- NotificationService::AllSources(),
- NotificationService::NoDetails());
+ NotificationService::current()->Notify(
+ chrome::NOTIFICATION_GOOGLE_URL_UPDATED,
+ NotificationService::AllSources(),
+ NotificationService::NoDetails());
need_to_prompt_ = false;
}
@@ -288,26 +290,26 @@ void GoogleURLTracker::RedoSearch() {
PageTransition::GENERATED);
}
-void GoogleURLTracker::Observe(NotificationType type,
+void GoogleURLTracker::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::NAV_ENTRY_PENDING: {
+ switch (type) {
+ case content::NOTIFICATION_NAV_ENTRY_PENDING: {
NavigationController* controller =
Source<NavigationController>(source).ptr();
OnNavigationPending(source, controller->pending_entry()->url());
break;
}
- case NotificationType::NAV_ENTRY_COMMITTED:
- case NotificationType::TAB_CLOSED:
+ case content::NOTIFICATION_NAV_ENTRY_COMMITTED:
+ case content::NOTIFICATION_TAB_CLOSED:
OnNavigationCommittedOrTabClosed(
Source<NavigationController>(source).ptr()->tab_contents(),
- type.value);
+ type);
break;
default:
- NOTREACHED() << "Unknown notification received:" << type.value;
+ NOTREACHED() << "Unknown notification received:" << type;
}
}
@@ -320,7 +322,7 @@ void GoogleURLTracker::SearchCommitted() {
if (registrar_.IsEmpty() && (need_to_prompt_ || fetcher_.get())) {
// This notification will fire a bit later in the same call chain we're
// currently in.
- registrar_.Add(this, NotificationType::NAV_ENTRY_PENDING,
+ registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
NotificationService::AllSources());
}
}
@@ -329,22 +331,22 @@ void GoogleURLTracker::OnNavigationPending(const NotificationSource& source,
const GURL& pending_url) {
controller_ = Source<NavigationController>(source).ptr();
search_url_ = pending_url;
- registrar_.Remove(this, NotificationType::NAV_ENTRY_PENDING,
+ registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
NotificationService::AllSources());
// Start listening for the commit notification. We also need to listen for the
// tab close command since that means the load will never commit.
- registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED,
+ registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
Source<NavigationController>(controller_));
- registrar_.Add(this, NotificationType::TAB_CLOSED,
+ registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED,
Source<NavigationController>(controller_));
}
void GoogleURLTracker::OnNavigationCommittedOrTabClosed(
TabContents* tab_contents,
- NotificationType::Type type) {
+ int type) {
registrar_.RemoveAll();
- if (type == NotificationType::NAV_ENTRY_COMMITTED) {
+ if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) {
ShowGoogleURLInfoBarIfNecessary(tab_contents);
} else {
controller_ = NULL;