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

Side by Side Diff: ash/display/resolution_notification_controller.cc

Issue 687183004: Remove the OnError method from notification delegates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/display/resolution_notification_controller.h" 5 #include "ash/display/resolution_notification_controller.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/display_info.h" 8 #include "ash/display/display_info.h"
9 #include "ash/display/display_manager.h" 9 #include "ash/display/display_manager.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 23 matching lines...) Expand all
34 ResolutionChangeNotificationDelegate( 34 ResolutionChangeNotificationDelegate(
35 ResolutionNotificationController* controller, 35 ResolutionNotificationController* controller,
36 bool has_timeout); 36 bool has_timeout);
37 37
38 protected: 38 protected:
39 virtual ~ResolutionChangeNotificationDelegate(); 39 virtual ~ResolutionChangeNotificationDelegate();
40 40
41 private: 41 private:
42 // message_center::NotificationDelegate overrides: 42 // message_center::NotificationDelegate overrides:
43 virtual void Display() override; 43 virtual void Display() override;
44 virtual void Error() override;
45 virtual void Close(bool by_user) override; 44 virtual void Close(bool by_user) override;
46 virtual void Click() override; 45 virtual void Click() override;
47 virtual bool HasClickedListener() override; 46 virtual bool HasClickedListener() override;
48 virtual void ButtonClick(int button_index) override; 47 virtual void ButtonClick(int button_index) override;
49 48
50 ResolutionNotificationController* controller_; 49 ResolutionNotificationController* controller_;
51 bool has_timeout_; 50 bool has_timeout_;
52 51
53 DISALLOW_COPY_AND_ASSIGN(ResolutionChangeNotificationDelegate); 52 DISALLOW_COPY_AND_ASSIGN(ResolutionChangeNotificationDelegate);
54 }; 53 };
55 54
56 ResolutionChangeNotificationDelegate::ResolutionChangeNotificationDelegate( 55 ResolutionChangeNotificationDelegate::ResolutionChangeNotificationDelegate(
57 ResolutionNotificationController* controller, 56 ResolutionNotificationController* controller,
58 bool has_timeout) 57 bool has_timeout)
59 : controller_(controller), 58 : controller_(controller),
60 has_timeout_(has_timeout) { 59 has_timeout_(has_timeout) {
61 DCHECK(controller_); 60 DCHECK(controller_);
62 } 61 }
63 62
64 ResolutionChangeNotificationDelegate::~ResolutionChangeNotificationDelegate() { 63 ResolutionChangeNotificationDelegate::~ResolutionChangeNotificationDelegate() {
65 } 64 }
66 65
67 void ResolutionChangeNotificationDelegate::Display() { 66 void ResolutionChangeNotificationDelegate::Display() {
68 } 67 }
69 68
70 void ResolutionChangeNotificationDelegate::Error() {
71 }
72
73 void ResolutionChangeNotificationDelegate::Close(bool by_user) { 69 void ResolutionChangeNotificationDelegate::Close(bool by_user) {
74 if (by_user) 70 if (by_user)
75 controller_->AcceptResolutionChange(false); 71 controller_->AcceptResolutionChange(false);
76 } 72 }
77 73
78 void ResolutionChangeNotificationDelegate::Click() { 74 void ResolutionChangeNotificationDelegate::Click() {
79 controller_->AcceptResolutionChange(true); 75 controller_->AcceptResolutionChange(true);
80 } 76 }
81 77
82 bool ResolutionChangeNotificationDelegate::HasClickedListener() { 78 bool ResolutionChangeNotificationDelegate::HasClickedListener() {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 this, 305 this,
310 &ResolutionNotificationController::OnTimerTick); 306 &ResolutionNotificationController::OnTimerTick);
311 } 307 }
312 } 308 }
313 309
314 void ResolutionNotificationController::SuppressTimerForTest() { 310 void ResolutionNotificationController::SuppressTimerForTest() {
315 g_use_timer = false; 311 g_use_timer = false;
316 } 312 }
317 313
318 } // namespace ash 314 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698