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

Side by Side Diff: content/browser/renderer_host/text_input_client_mac.mm

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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 #import "content/browser/renderer_host/text_input_client_mac.h" 5 #import "content/browser/renderer_host/text_input_client_mac.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/threading/thread_restrictions.h" 9 #include "base/threading/thread_restrictions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 12 matching lines...) Expand all
23 : character_index_(NSNotFound), 23 : character_index_(NSNotFound),
24 lock_(), 24 lock_(),
25 condition_(&lock_) { 25 condition_(&lock_) {
26 } 26 }
27 27
28 TextInputClientMac::~TextInputClientMac() { 28 TextInputClientMac::~TextInputClientMac() {
29 } 29 }
30 30
31 // static 31 // static
32 TextInputClientMac* TextInputClientMac::GetInstance() { 32 TextInputClientMac* TextInputClientMac::GetInstance() {
33 return Singleton<TextInputClientMac>::get(); 33 return base::Singleton<TextInputClientMac>::get();
34 } 34 }
35 35
36 void TextInputClientMac::GetStringAtPoint( 36 void TextInputClientMac::GetStringAtPoint(
37 RenderWidgetHost* rwh, 37 RenderWidgetHost* rwh,
38 gfx::Point point, 38 gfx::Point point,
39 void (^replyHandler)(NSAttributedString*, NSPoint)) { 39 void (^replyHandler)(NSAttributedString*, NSPoint)) {
40 DCHECK(replyHandler_.get() == nil); 40 DCHECK(replyHandler_.get() == nil);
41 replyHandler_.reset(replyHandler, base::scoped_policy::RETAIN); 41 replyHandler_.reset(replyHandler, base::scoped_policy::RETAIN);
42 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); 42 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh);
43 rwhi->Send(new TextInputClientMsg_StringAtPoint(rwhi->GetRoutingID(), point)); 43 rwhi->Send(new TextInputClientMsg_StringAtPoint(rwhi->GetRoutingID(), point));
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 character_index_ = NSNotFound; 149 character_index_ = NSNotFound;
150 first_rect_ = NSZeroRect; 150 first_rect_ = NSZeroRect;
151 substring_.reset(); 151 substring_.reset();
152 } 152 }
153 153
154 void TextInputClientMac::AfterRequest() { 154 void TextInputClientMac::AfterRequest() {
155 lock_.Release(); 155 lock_.Release();
156 } 156 }
157 157
158 } // namespace content 158 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/text_input_client_mac.h ('k') | content/browser/shared_worker/shared_worker_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698