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

Side by Side Diff: blimp/engine/session/blimp_engine_session.cc

Issue 2370393002: Extracting placeholder information from Webkit to Blimp (Closed)
Patch Set: dtrainor comments Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "blimp/engine/session/blimp_engine_session.h" 5 #include "blimp/engine/session/blimp_engine_session.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 // - the TextInputClient is changed (e.g. by a change of focus) 395 // - the TextInputClient is changed (e.g. by a change of focus)
396 // - the TextInputType of the TextInputClient changes 396 // - the TextInputType of the TextInputClient changes
397 void BlimpEngineSession::OnTextInputStateChanged( 397 void BlimpEngineSession::OnTextInputStateChanged(
398 const ui::TextInputClient* client) { 398 const ui::TextInputClient* client) {
399 if (!tab_ || !tab_->web_contents()->GetRenderWidgetHostView()) 399 if (!tab_ || !tab_->web_contents()->GetRenderWidgetHostView())
400 return; 400 return;
401 401
402 ui::TextInputType type = 402 ui::TextInputType type =
403 client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE; 403 client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE;
404 404
405 // TODO(shaktisahu): Propagate the new type to the client.
406 // Hide IME, when text input is out of focus, i.e. if the text input type 405 // Hide IME, when text input is out of focus, i.e. if the text input type
407 // changes to ui::TEXT_INPUT_TYPE_NONE. For other text input types, 406 // changes to ui::TEXT_INPUT_TYPE_NONE. For other text input types,
408 // OnShowImeIfNeeded is used instead to send show IME request to client. 407 // OnShowImeIfNeeded is used instead to send show IME request to client.
409 if (type == ui::TEXT_INPUT_TYPE_NONE) 408 if (type == ui::TEXT_INPUT_TYPE_NONE)
410 render_widget_feature_.SendHideImeRequest( 409 tab_->HideIme();
411 tab_->tab_id(),
412 tab_->web_contents()->GetRenderWidgetHostView()->GetRenderWidgetHost());
413 } 410 }
414 411
415 void BlimpEngineSession::OnInputMethodDestroyed( 412 void BlimpEngineSession::OnInputMethodDestroyed(
416 const ui::InputMethod* input_method) {} 413 const ui::InputMethod* input_method) {}
417 414
418 // Called when a user input should trigger showing the IME. 415 // Called when a user input should trigger showing the IME.
419 void BlimpEngineSession::OnShowImeIfNeeded() { 416 void BlimpEngineSession::OnShowImeIfNeeded() {
420 TRACE_EVENT0("blimp", "BlimpEngineSession::OnShowImeIfNeeded"); 417 TRACE_EVENT0("blimp", "BlimpEngineSession::OnShowImeIfNeeded");
421 if (!tab_ || !tab_->web_contents()->GetRenderWidgetHostView() || 418 if (!tab_ || !tab_->web_contents()->GetRenderWidgetHostView() ||
422 !window_tree_host_->GetInputMethod()->GetTextInputClient()) 419 !window_tree_host_->GetInputMethod()->GetTextInputClient())
423 return; 420 return;
424 421
425 render_widget_feature_.SendShowImeRequest( 422 tab_->ShowIme();
426 tab_->tab_id(),
427 tab_->web_contents()->GetRenderWidgetHostView()->GetRenderWidgetHost(),
428 window_tree_host_->GetInputMethod()->GetTextInputClient());
429 } 423 }
430 424
431 void BlimpEngineSession::ProcessMessage( 425 void BlimpEngineSession::ProcessMessage(
432 std::unique_ptr<BlimpMessage> message, 426 std::unique_ptr<BlimpMessage> message,
433 const net::CompletionCallback& callback) { 427 const net::CompletionCallback& callback) {
434 TRACE_EVENT1("blimp", "BlimpEngineSession::ProcessMessage", "TabId", 428 TRACE_EVENT1("blimp", "BlimpEngineSession::ProcessMessage", "TabId",
435 message->target_tab_id()); 429 message->target_tab_id());
436 DCHECK(!callback.is_null()); 430 DCHECK(!callback.is_null());
437 DCHECK(BlimpMessage::kTabControl == message->feature_case() || 431 DCHECK(BlimpMessage::kTabControl == message->feature_case() ||
438 BlimpMessage::kNavigation == message->feature_case()); 432 BlimpMessage::kNavigation == message->feature_case());
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 parent->AddChild(content); 560 parent->AddChild(content);
567 content->Show(); 561 content->Show();
568 562
569 tab_ = base::MakeUnique<Tab>(std::move(new_contents), target_tab_id, 563 tab_ = base::MakeUnique<Tab>(std::move(new_contents), target_tab_id,
570 &render_widget_feature_, 564 &render_widget_feature_,
571 navigation_message_sender_.get()); 565 navigation_message_sender_.get());
572 } 566 }
573 567
574 } // namespace engine 568 } // namespace engine
575 } // namespace blimp 569 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698