| OLD | NEW |
| 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| 11 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 12 #include "base/debug/alias.h" | 13 #include "base/debug/alias.h" |
| 13 #include "base/debug/asan_invalid_access.h" | 14 #include "base/debug/asan_invalid_access.h" |
| 14 #include "base/debug/dump_without_crashing.h" | 15 #include "base/debug/dump_without_crashing.h" |
| 15 #include "base/i18n/char_iterator.h" | 16 #include "base/i18n/char_iterator.h" |
| 16 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 17 #include "base/process/process.h" | 18 #include "base/process/process.h" |
| 18 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 20 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| (...skipping 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3114 if (is_empty_selection) | 3115 if (is_empty_selection) |
| 3115 selection_text_.clear(); | 3116 selection_text_.clear(); |
| 3116 | 3117 |
| 3117 // UpdateTextInputState should be called before SyncSelectionIfRequired. | 3118 // UpdateTextInputState should be called before SyncSelectionIfRequired. |
| 3118 // UpdateTextInputState may send TextInputStateChanged to notify the focus | 3119 // UpdateTextInputState may send TextInputStateChanged to notify the focus |
| 3119 // was changed, and SyncSelectionIfRequired may send SelectionChanged | 3120 // was changed, and SyncSelectionIfRequired may send SelectionChanged |
| 3120 // to notify the selection was changed. Focus change should be notified | 3121 // to notify the selection was changed. Focus change should be notified |
| 3121 // before selection change. | 3122 // before selection change. |
| 3122 GetRenderWidget()->UpdateTextInputState( | 3123 GetRenderWidget()->UpdateTextInputState( |
| 3123 RenderWidget::NO_SHOW_IME, RenderWidget::FROM_NON_IME); | 3124 RenderWidget::NO_SHOW_IME, RenderWidget::FROM_NON_IME); |
| 3124 SyncSelectionIfRequired(); | 3125 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 3126 FROM_HERE, |
| 3127 base::Bind(&RenderFrameImpl::SyncSelectionIfRequired, AsWeakPtr())); |
| 3125 } | 3128 } |
| 3126 | 3129 |
| 3127 blink::WebColorChooser* RenderFrameImpl::createColorChooser( | 3130 blink::WebColorChooser* RenderFrameImpl::createColorChooser( |
| 3128 blink::WebColorChooserClient* client, | 3131 blink::WebColorChooserClient* client, |
| 3129 const blink::WebColor& initial_color, | 3132 const blink::WebColor& initial_color, |
| 3130 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { | 3133 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { |
| 3131 RendererWebColorChooserImpl* color_chooser = | 3134 RendererWebColorChooserImpl* color_chooser = |
| 3132 new RendererWebColorChooserImpl(this, client); | 3135 new RendererWebColorChooserImpl(this, client); |
| 3133 std::vector<ColorSuggestion> color_suggestions; | 3136 std::vector<ColorSuggestion> color_suggestions; |
| 3134 for (size_t i = 0; i < suggestions.size(); i++) { | 3137 for (size_t i = 0; i < suggestions.size(); i++) { |
| (...skipping 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5208 mojo::ServiceProviderPtr service_provider; | 5211 mojo::ServiceProviderPtr service_provider; |
| 5209 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 5212 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
| 5210 request->url = mojo::String::From(url); | 5213 request->url = mojo::String::From(url); |
| 5211 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), | 5214 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), |
| 5212 nullptr, nullptr, | 5215 nullptr, nullptr, |
| 5213 base::Bind(&OnGotContentHandlerID)); | 5216 base::Bind(&OnGotContentHandlerID)); |
| 5214 return service_provider.Pass(); | 5217 return service_provider.Pass(); |
| 5215 } | 5218 } |
| 5216 | 5219 |
| 5217 } // namespace content | 5220 } // namespace content |
| OLD | NEW |