| OLD | NEW |
| 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 #include <vector> | 5 #include <vector> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <cstdio> | 7 #include <cstdio> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 const base::TimeDelta& max_delay, | 521 const base::TimeDelta& max_delay, |
| 522 IPC::Message* msg) { | 522 IPC::Message* msg) { |
| 523 return false; | 523 return false; |
| 524 } | 524 } |
| 525 | 525 |
| 526 virtual bool Send(IPC::Message* msg) { | 526 virtual bool Send(IPC::Message* msg) { |
| 527 VisitCountingProfile* counting_profile = | 527 VisitCountingProfile* counting_profile = |
| 528 static_cast<VisitCountingProfile*>( | 528 static_cast<VisitCountingProfile*>( |
| 529 Profile::FromBrowserContext(browser_context())); | 529 Profile::FromBrowserContext(browser_context())); |
| 530 | 530 |
| 531 if (msg->type() == ViewMsg_VisitedLink_Add::ID) { | 531 if (msg->type() == ChromeViewMsg_VisitedLink_Add::ID) { |
| 532 void* iter = NULL; | 532 void* iter = NULL; |
| 533 std::vector<uint64> fingerprints; | 533 std::vector<uint64> fingerprints; |
| 534 CHECK(IPC::ReadParam(msg, &iter, &fingerprints)); | 534 CHECK(IPC::ReadParam(msg, &iter, &fingerprints)); |
| 535 counting_profile->CountAddEvent(fingerprints.size()); | 535 counting_profile->CountAddEvent(fingerprints.size()); |
| 536 } else if (msg->type() == ViewMsg_VisitedLink_Reset::ID) { | 536 } else if (msg->type() == ChromeViewMsg_VisitedLink_Reset::ID) { |
| 537 counting_profile->CountResetEvent(); | 537 counting_profile->CountResetEvent(); |
| 538 } | 538 } |
| 539 | 539 |
| 540 delete msg; | 540 delete msg; |
| 541 return true; | 541 return true; |
| 542 } | 542 } |
| 543 | 543 |
| 544 virtual void SetBackgrounded(bool backgrounded) { | 544 virtual void SetBackgrounded(bool backgrounded) { |
| 545 backgrounded_ = backgrounded; | 545 backgrounded_ = backgrounded; |
| 546 } | 546 } |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 EXPECT_EQ(1, profile()->add_event_count()); | 721 EXPECT_EQ(1, profile()->add_event_count()); |
| 722 EXPECT_EQ(0, profile()->reset_event_count()); | 722 EXPECT_EQ(0, profile()->reset_event_count()); |
| 723 | 723 |
| 724 // Activate the tab. | 724 // Activate the tab. |
| 725 rvh()->WasRestored(); | 725 rvh()->WasRestored(); |
| 726 | 726 |
| 727 // We should have only one more reset event. | 727 // We should have only one more reset event. |
| 728 EXPECT_EQ(1, profile()->add_event_count()); | 728 EXPECT_EQ(1, profile()->add_event_count()); |
| 729 EXPECT_EQ(1, profile()->reset_event_count()); | 729 EXPECT_EQ(1, profile()->reset_event_count()); |
| 730 } | 730 } |
| OLD | NEW |