| OLD | NEW |
| 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.h" | 10 #include "base/time.h" |
| 11 #include "content/browser/renderer_host/render_widget_host_impl.h" | 11 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 12 #include "content/common/text_input_client_messages.h" | 12 #include "content/common/text_input_client_messages.h" |
| 13 | 13 |
| 14 using content::RenderWidgetHost; | 14 namespace content { |
| 15 using content::RenderWidgetHostImpl; | |
| 16 | 15 |
| 17 // The amount of time in milliseconds that the browser process will wait for a | 16 // The amount of time in milliseconds that the browser process will wait for a |
| 18 // response from the renderer. | 17 // response from the renderer. |
| 19 // TODO(rsesek): Using the histogram data, find the best upper-bound for this | 18 // TODO(rsesek): Using the histogram data, find the best upper-bound for this |
| 20 // value. | 19 // value. |
| 21 const float kWaitTimeout = 1500; | 20 const float kWaitTimeout = 1500; |
| 22 | 21 |
| 23 TextInputClientMac::TextInputClientMac() | 22 TextInputClientMac::TextInputClientMac() |
| 24 : character_index_(NSNotFound), | 23 : character_index_(NSNotFound), |
| 25 lock_(), | 24 lock_(), |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 delta * base::Time::kMicrosecondsPerMillisecond); | 129 delta * base::Time::kMicrosecondsPerMillisecond); |
| 131 | 130 |
| 132 character_index_ = NSNotFound; | 131 character_index_ = NSNotFound; |
| 133 first_rect_ = NSZeroRect; | 132 first_rect_ = NSZeroRect; |
| 134 substring_.reset(); | 133 substring_.reset(); |
| 135 } | 134 } |
| 136 | 135 |
| 137 void TextInputClientMac::AfterRequest() { | 136 void TextInputClientMac::AfterRequest() { |
| 138 lock_.Release(); | 137 lock_.Release(); |
| 139 } | 138 } |
| 139 |
| 140 } // namespace content |
| OLD | NEW |