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

Side by Side Diff: components/web_modal/web_contents_modal_dialog_manager_unittest.cc

Issue 666133002: Standardize usage of virtual/override/final in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 "components/web_modal/web_contents_modal_dialog_manager.h" 5 #include "components/web_modal/web_contents_modal_dialog_manager.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "components/web_modal/single_web_contents_dialog_manager.h" 10 #include "components/web_modal/single_web_contents_dialog_manager.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 NativeWebContentsModalDialog dialog, 46 NativeWebContentsModalDialog dialog,
47 SingleWebContentsDialogManagerDelegate* delegate, 47 SingleWebContentsDialogManagerDelegate* delegate,
48 NativeManagerTracker* tracker) 48 NativeManagerTracker* tracker)
49 : delegate_(delegate), 49 : delegate_(delegate),
50 dialog_(dialog), 50 dialog_(dialog),
51 tracker_(tracker) { 51 tracker_(tracker) {
52 if (tracker_) 52 if (tracker_)
53 tracker_->SetState(NativeManagerTracker::NOT_SHOWN); 53 tracker_->SetState(NativeManagerTracker::NOT_SHOWN);
54 } 54 }
55 55
56 virtual void Show() override { 56 void Show() override {
57 if (tracker_) 57 if (tracker_)
58 tracker_->SetState(NativeManagerTracker::SHOWN); 58 tracker_->SetState(NativeManagerTracker::SHOWN);
59 } 59 }
60 virtual void Hide() override { 60 void Hide() override {
61 if (tracker_) 61 if (tracker_)
62 tracker_->SetState(NativeManagerTracker::HIDDEN); 62 tracker_->SetState(NativeManagerTracker::HIDDEN);
63 } 63 }
64 virtual void Close() override { 64 void Close() override {
65 if (tracker_) 65 if (tracker_)
66 tracker_->SetState(NativeManagerTracker::CLOSED); 66 tracker_->SetState(NativeManagerTracker::CLOSED);
67 delegate_->WillClose(dialog_); 67 delegate_->WillClose(dialog_);
68 } 68 }
69 virtual void Focus() override { 69 void Focus() override {}
70 } 70 void Pulse() override {}
71 virtual void Pulse() override { 71 void HostChanged(WebContentsModalDialogHost* new_host) override {}
72 } 72 NativeWebContentsModalDialog dialog() override { return dialog_; }
73 virtual void HostChanged(WebContentsModalDialogHost* new_host) override {
74 }
75 virtual NativeWebContentsModalDialog dialog() override {
76 return dialog_;
77 }
78 73
79 void StopTracking() { 74 void StopTracking() {
80 tracker_ = NULL; 75 tracker_ = NULL;
81 } 76 }
82 77
83 private: 78 private:
84 SingleWebContentsDialogManagerDelegate* delegate_; 79 SingleWebContentsDialogManagerDelegate* delegate_;
85 NativeWebContentsModalDialog dialog_; 80 NativeWebContentsModalDialog dialog_;
86 NativeManagerTracker* tracker_; 81 NativeManagerTracker* tracker_;
87 82
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 365
371 test_api->CloseAllDialogs(); 366 test_api->CloseAllDialogs();
372 367
373 EXPECT_FALSE(delegate->web_contents_blocked()); 368 EXPECT_FALSE(delegate->web_contents_blocked());
374 EXPECT_FALSE(manager->IsDialogActive()); 369 EXPECT_FALSE(manager->IsDialogActive());
375 for (int i = 0; i < kWindowCount; i++) 370 for (int i = 0; i < kWindowCount; i++)
376 EXPECT_EQ(NativeManagerTracker::CLOSED, trackers[i].state_); 371 EXPECT_EQ(NativeManagerTracker::CLOSED, trackers[i].state_);
377 } 372 }
378 373
379 } // namespace web_modal 374 } // namespace web_modal
OLDNEW
« no previous file with comments | « components/web_modal/web_contents_modal_dialog_manager.h ('k') | components/webdata/common/web_data_service_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698