summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/omnibox/omnibox_edit_model.cc
diff options
context:
space:
mode:
authorkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-28 22:58:06 +0000
committerkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-28 22:58:06 +0000
commit416d753a3646cef8ae2e3174e93e4ed266913432 (patch)
tree7ce065a402dd4633b4c1ef5ee11cf0410f66e716 /chrome/browser/ui/omnibox/omnibox_edit_model.cc
parentc4edfeb7480fbe2ef45415fff655ca75688dac14 (diff)
downloadchromium_src-416d753a3646cef8ae2e3174e93e4ed266913432.zip
chromium_src-416d753a3646cef8ae2e3174e93e4ed266913432.tar.gz
chromium_src-416d753a3646cef8ae2e3174e93e4ed266913432.tar.bz2
Send ChromeViewMsg_SearchBoxFocusChanged IPC msg and ChromeViewMsg_SearchBoxSetInputInProgress IPC msg from SearchIPCRouter.
This CL, - Removes OmniboxFocusState details from InstantController. - Deletes InstantIPCSender and updates the InstantPage class. - Adds a new function in OmniboxCurrentPageDelegate to notify the client (such as SearchTabHelper) about the omnibox focus state change event. - Adds a new function in SearchIPCRouter to send a message to the underlying page about the focus change event. - Adds unit tests. BUG=272583 TEST=none Review URL: https://codereview.chromium.org/159713009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254262 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/omnibox/omnibox_edit_model.cc')
-rw-r--r--chrome/browser/ui/omnibox/omnibox_edit_model.cc19
1 files changed, 3 insertions, 16 deletions
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
index f724bc5..d5cc346 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -50,7 +50,6 @@
#include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
#include "chrome/browser/ui/omnibox/omnibox_popup_view.h"
#include "chrome/browser/ui/omnibox/omnibox_view.h"
-#include "chrome/browser/ui/search/instant_controller.h"
#include "chrome/browser/ui/search/instant_search_prerenderer.h"
#include "chrome/browser/ui/search/search_tab_helper.h"
#include "chrome/browser/ui/toolbar/toolbar_model.h"
@@ -934,13 +933,6 @@ void OmniboxEditModel::SetCaretVisibility(bool visible) {
}
void OmniboxEditModel::OnWillKillFocus(gfx::NativeView view_gaining_focus) {
- InstantController* instant = GetInstantController();
- if (instant) {
- instant->OmniboxFocusChanged(OMNIBOX_FOCUS_NONE,
- OMNIBOX_FOCUS_CHANGE_EXPLICIT,
- view_gaining_focus);
- }
-
// TODO(jered): Rip this out along with StartZeroSuggest.
autocomplete_controller()->StopZeroSuggest();
@@ -949,10 +941,7 @@ void OmniboxEditModel::OnWillKillFocus(gfx::NativeView view_gaining_focus) {
}
void OmniboxEditModel::OnKillFocus() {
- // TODO(samarth): determine if it is safe to move the call to
- // OmniboxFocusChanged() from OnWillKillFocus() to here, which would let us
- // just call SetFocusState() to handle the state change.
- focus_state_ = OMNIBOX_FOCUS_NONE;
+ SetFocusState(OMNIBOX_FOCUS_NONE, OMNIBOX_FOCUS_CHANGE_EXPLICIT);
focus_source_ = INVALID;
control_key_state_ = UP;
paste_state_ = NONE;
@@ -1436,10 +1425,6 @@ void OmniboxEditModel::SetFocusState(OmniboxFocusState state,
if (state == focus_state_)
return;
- InstantController* instant = GetInstantController();
- if (instant)
- instant->OmniboxFocusChanged(state, reason, NULL);
-
// Update state and notify view if the omnibox has focus and the caret
// visibility changed.
const bool was_caret_visible = is_caret_visible();
@@ -1447,4 +1432,6 @@ void OmniboxEditModel::SetFocusState(OmniboxFocusState state,
if (focus_state_ != OMNIBOX_FOCUS_NONE &&
is_caret_visible() != was_caret_visible)
view_->ApplyCaretVisibility();
+
+ delegate_->OnFocusChanged(focus_state_, reason);
}