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

Side by Side Diff: chrome/browser/rlz/rlz.cc

Issue 8956059: Rename NavigationController to NavigationControllerImpl and put it into the content namespace. Al... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/printing/print_dialog_cloud.cc ('k') | chrome/browser/rlz/rlz_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This code glues the RLZ library DLL with Chrome. It allows Chrome to work 5 // This code glues the RLZ library DLL with Chrome. It allows Chrome to work
6 // with or without the DLL being present. If the DLL is not present the 6 // with or without the DLL being present. If the DLL is not present the
7 // functions do nothing and just return false. 7 // functions do nothing and just return false.
8 8
9 #include "chrome/browser/rlz/rlz.h" 9 #include "chrome/browser/rlz/rlz.h"
10 10
(...skipping 19 matching lines...) Expand all
30 #include "chrome/browser/search_engines/template_url_service_factory.h" 30 #include "chrome/browser/search_engines/template_url_service_factory.h"
31 #include "chrome/common/chrome_notification_types.h" 31 #include "chrome/common/chrome_notification_types.h"
32 #include "chrome/common/chrome_paths.h" 32 #include "chrome/common/chrome_paths.h"
33 #include "chrome/common/env_vars.h" 33 #include "chrome/common/env_vars.h"
34 #include "chrome/installer/util/google_update_settings.h" 34 #include "chrome/installer/util/google_update_settings.h"
35 #include "content/public/browser/browser_thread.h" 35 #include "content/public/browser/browser_thread.h"
36 #include "content/public/browser/navigation_entry.h" 36 #include "content/public/browser/navigation_entry.h"
37 #include "content/public/browser/notification_service.h" 37 #include "content/public/browser/notification_service.h"
38 38
39 using content::BrowserThread; 39 using content::BrowserThread;
40 using content::NavigationEntry;
40 41
41 namespace { 42 namespace {
42 43
43 bool IsBrandOrganic(const std::string& brand) { 44 bool IsBrandOrganic(const std::string& brand) {
44 return brand.empty() || google_util::IsOrganic(brand); 45 return brand.empty() || google_util::IsOrganic(brand);
45 } 46 }
46 47
47 void RecordProductEvents(bool first_run, bool google_default_search, 48 void RecordProductEvents(bool first_run, bool google_default_search,
48 bool google_default_homepage, bool already_ran, 49 bool google_default_homepage, bool already_ran,
49 bool omnibox_used, bool homepage_used) { 50 bool omnibox_used, bool homepage_used) {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 point = rlz_lib::CHROME_OMNIBOX; 299 point = rlz_lib::CHROME_OMNIBOX;
299 record_used = &omnibox_used_; 300 record_used = &omnibox_used_;
300 call_record = true; 301 call_record = true;
301 302
302 registrar_.Remove(this, chrome::NOTIFICATION_OMNIBOX_OPENED_URL, 303 registrar_.Remove(this, chrome::NOTIFICATION_OMNIBOX_OPENED_URL,
303 content::NotificationService::AllSources()); 304 content::NotificationService::AllSources());
304 registrar_.Remove(this, chrome::NOTIFICATION_INSTANT_CONTROLLER_UPDATED, 305 registrar_.Remove(this, chrome::NOTIFICATION_INSTANT_CONTROLLER_UPDATED,
305 content::NotificationService::AllSources()); 306 content::NotificationService::AllSources());
306 break; 307 break;
307 case content::NOTIFICATION_NAV_ENTRY_PENDING: { 308 case content::NOTIFICATION_NAV_ENTRY_PENDING: {
308 const content::NavigationEntry* entry = 309 const NavigationEntry* entry =
309 content::Details<content::NavigationEntry>(details).ptr(); 310 content::Details<NavigationEntry>(details).ptr();
310 if (entry != NULL && 311 if (entry != NULL &&
311 ((entry->GetTransitionType() & 312 ((entry->GetTransitionType() &
312 content::PAGE_TRANSITION_HOME_PAGE) != 0)) { 313 content::PAGE_TRANSITION_HOME_PAGE) != 0)) {
313 point = rlz_lib::CHROME_HOME_PAGE; 314 point = rlz_lib::CHROME_HOME_PAGE;
314 record_used = &homepage_used_; 315 record_used = &homepage_used_;
315 call_record = true; 316 call_record = true;
316 317
317 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_PENDING, 318 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
318 content::NotificationService::AllSources()); 319 content::NotificationService::AllSources());
319 } 320 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 base::IgnoreReturn<bool>( 402 base::IgnoreReturn<bool>(
402 base::Bind(&RLZTracker::GetAccessPointRlz, point, not_used))); 403 base::Bind(&RLZTracker::GetAccessPointRlz, point, not_used)));
403 return true; 404 return true;
404 } 405 }
405 406
406 // static 407 // static
407 void RLZTracker::CleanupRlz() { 408 void RLZTracker::CleanupRlz() {
408 GetInstance()->rlz_cache_.clear(); 409 GetInstance()->rlz_cache_.clear();
409 GetInstance()->registrar_.RemoveAll(); 410 GetInstance()->registrar_.RemoveAll();
410 } 411 }
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_dialog_cloud.cc ('k') | chrome/browser/rlz/rlz_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698