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

Side by Side Diff: chrome/browser/background/background_contents_service_unittest.cc

Issue 625113002: replace OVERRIDE and FINAL with override and final in chrome/browser/[a-i]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix newly added OVERRIDEs Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 service->BackgroundContentsOpened(&details, profile_); 83 service->BackgroundContentsOpened(&details, profile_);
84 } 84 }
85 85
86 virtual void Navigate(GURL url) { 86 virtual void Navigate(GURL url) {
87 url_ = url; 87 url_ = url;
88 content::NotificationService::current()->Notify( 88 content::NotificationService::current()->Notify(
89 chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED, 89 chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED,
90 content::Source<Profile>(profile_), 90 content::Source<Profile>(profile_),
91 content::Details<BackgroundContents>(this)); 91 content::Details<BackgroundContents>(this));
92 } 92 }
93 virtual const GURL& GetURL() const OVERRIDE { return url_; } 93 virtual const GURL& GetURL() const override { return url_; }
94 94
95 void MockClose(Profile* profile) { 95 void MockClose(Profile* profile) {
96 content::NotificationService::current()->Notify( 96 content::NotificationService::current()->Notify(
97 chrome::NOTIFICATION_BACKGROUND_CONTENTS_CLOSED, 97 chrome::NOTIFICATION_BACKGROUND_CONTENTS_CLOSED,
98 content::Source<Profile>(profile), 98 content::Source<Profile>(profile),
99 content::Details<BackgroundContents>(this)); 99 content::Details<BackgroundContents>(this));
100 delete this; 100 delete this;
101 } 101 }
102 102
103 virtual ~MockBackgroundContents() { 103 virtual ~MockBackgroundContents() {
(...skipping 29 matching lines...) Expand all
133 message_center::MessageCenter::Get(); 133 message_center::MessageCenter::Get();
134 134
135 message_center->AddObserver(this); 135 message_center->AddObserver(this);
136 run_loop_.Run(); 136 run_loop_.Run();
137 message_center->RemoveObserver(this); 137 message_center->RemoveObserver(this);
138 } 138 }
139 139
140 private: 140 private:
141 // message_center::MessageCenterObserver overrides: 141 // message_center::MessageCenterObserver overrides:
142 virtual void OnNotificationAdded( 142 virtual void OnNotificationAdded(
143 const std::string& notification_id) OVERRIDE { 143 const std::string& notification_id) override {
144 if (notification_id == FindNotificationIdFromDelegateId(target_id_)) 144 if (notification_id == FindNotificationIdFromDelegateId(target_id_))
145 run_loop_.Quit(); 145 run_loop_.Quit();
146 } 146 }
147 147
148 virtual void OnNotificationUpdated( 148 virtual void OnNotificationUpdated(
149 const std::string& notification_id) OVERRIDE { 149 const std::string& notification_id) override {
150 if (notification_id == FindNotificationIdFromDelegateId(target_id_)) 150 if (notification_id == FindNotificationIdFromDelegateId(target_id_))
151 run_loop_.Quit(); 151 run_loop_.Quit();
152 } 152 }
153 153
154 std::string FindNotificationIdFromDelegateId(const std::string& delegate_id) { 154 std::string FindNotificationIdFromDelegateId(const std::string& delegate_id) {
155 MessageCenterNotificationManager* manager = 155 MessageCenterNotificationManager* manager =
156 static_cast<MessageCenterNotificationManager*>( 156 static_cast<MessageCenterNotificationManager*>(
157 g_browser_process->notification_ui_manager()); 157 g_browser_process->notification_ui_manager());
158 DCHECK(manager); 158 DCHECK(manager);
159 return manager->FindById(delegate_id, profile_)->id(); 159 return manager->FindById(delegate_id, profile_)->id();
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 CreateCrashNotification(extension); 387 CreateCrashNotification(extension);
388 CreateCrashNotification(extension); 388 CreateCrashNotification(extension);
389 389
390 message_center::MessageCenter* message_center = 390 message_center::MessageCenter* message_center =
391 message_center::MessageCenter::Get(); 391 message_center::MessageCenter::Get();
392 message_center::NotificationList::Notifications notifications = 392 message_center::NotificationList::Notifications notifications =
393 message_center->GetVisibleNotifications(); 393 message_center->GetVisibleNotifications();
394 ASSERT_EQ(1u, notifications.size()); 394 ASSERT_EQ(1u, notifications.size());
395 } 395 }
396 #endif 396 #endif
OLDNEW
« no previous file with comments | « chrome/browser/background/background_contents_service_factory.h ('k') | chrome/browser/background/background_mode_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698