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

Side by Side Diff: chrome/browser/ui/cocoa/about_ipc_controller.mm

Issue 5685007: Rename all methods accessing Singleton<T> as GetInstance(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "base/mac_util.h" 6 #include "base/mac_util.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 userString2_ = userString3_ = YES; 95 userString2_ = userString3_ = YES;
96 } 96 }
97 return self; 97 return self;
98 } 98 }
99 99
100 - (void)dealloc { 100 - (void)dealloc {
101 if (gSharedController == self) 101 if (gSharedController == self)
102 gSharedController = nil; 102 gSharedController = nil;
103 if (g_browser_process) 103 if (g_browser_process)
104 g_browser_process->SetIPCLoggingEnabled(false); // just in case... 104 g_browser_process->SetIPCLoggingEnabled(false); // just in case...
105 IPC::Logging::current()->SetConsumer(NULL); 105 IPC::Logging::GetInstance()->SetConsumer(NULL);
106 [super dealloc]; 106 [super dealloc];
107 } 107 }
108 108
109 - (void)awakeFromNib { 109 - (void)awakeFromNib {
110 // Running Chrome with the --ipc-logging switch might cause it to 110 // Running Chrome with the --ipc-logging switch might cause it to
111 // be enabled before the about:ipc window comes up; accomodate. 111 // be enabled before the about:ipc window comes up; accomodate.
112 [self updateVisibleRunState]; 112 [self updateVisibleRunState];
113 113
114 // We are now able to display information, so let'er rip. 114 // We are now able to display information, so let'er rip.
115 bridge_.reset(new AboutIPCBridge(self)); 115 bridge_.reset(new AboutIPCBridge(self));
116 IPC::Logging::current()->SetConsumer(bridge_.get()); 116 IPC::Logging::GetInstance()->SetConsumer(bridge_.get());
117 } 117 }
118 118
119 // Delegate callback. Closing the window means there is no more need 119 // Delegate callback. Closing the window means there is no more need
120 // for the me, the controller. 120 // for the me, the controller.
121 - (void)windowWillClose:(NSNotification*)notification { 121 - (void)windowWillClose:(NSNotification*)notification {
122 [self autorelease]; 122 [self autorelease];
123 } 123 }
124 124
125 - (void)updateVisibleRunState { 125 - (void)updateVisibleRunState {
126 if (IPC::Logging::current()->Enabled()) 126 if (IPC::Logging::GetInstance()->Enabled())
127 [startStopButton_ setTitle:@"Stop"]; 127 [startStopButton_ setTitle:@"Stop"];
128 else 128 else
129 [startStopButton_ setTitle:@"Start"]; 129 [startStopButton_ setTitle:@"Start"];
130 } 130 }
131 131
132 - (IBAction)startStop:(id)sender { 132 - (IBAction)startStop:(id)sender {
133 g_browser_process->SetIPCLoggingEnabled(!IPC::Logging::current()->Enabled()); 133 g_browser_process->SetIPCLoggingEnabled(!IPC::Logging::GetInstance()->Enabled( ));
134 [self updateVisibleRunState]; 134 [self updateVisibleRunState];
135 } 135 }
136 136
137 - (IBAction)clear:(id)sender { 137 - (IBAction)clear:(id)sender {
138 [dataController_ setContent:[NSMutableArray array]]; 138 [dataController_ setContent:[NSMutableArray array]];
139 [eventCount_ setStringValue:@"0"]; 139 [eventCount_ setStringValue:@"0"];
140 [filteredEventCount_ setStringValue:@"0"]; 140 [filteredEventCount_ setStringValue:@"0"];
141 filteredEventCounter_ = 0; 141 filteredEventCounter_ = 0;
142 } 142 }
143 143
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 190
191 - (void)setDisplayViewMessages:(BOOL)display { 191 - (void)setDisplayViewMessages:(BOOL)display {
192 view_ = display; 192 view_ = display;
193 } 193 }
194 194
195 @end 195 @end
196 196
197 #endif // IPC_MESSAGE_LOG_ENABLED 197 #endif // IPC_MESSAGE_LOG_ENABLED
198 198
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_init.cc ('k') | chrome/browser/ui/cocoa/page_info_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698