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

Side by Side Diff: components/omnibox/browser/omnibox_edit_model.cc

Issue 2755503002: Add a new entry to omnibox_event.proto to log specific type of contextual suggestions (Closed)
Patch Set: Created 3 years, 9 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "components/omnibox/browser/omnibox_edit_model.h" 5 #include "components/omnibox/browser/omnibox_edit_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 ui::PageTransitionFromInt( 682 ui::PageTransitionFromInt(
683 match.transition | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR), 683 match.transition | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR),
684 match.type); 684 match.type);
685 if (observer && observer->HasSeenPendingLoad()) 685 if (observer && observer->HasSeenPendingLoad())
686 ignore_result(observer.release()); // The observer will delete itself. 686 ignore_result(observer.release()); // The observer will delete itself.
687 } 687 }
688 688
689 BookmarkModel* bookmark_model = client_->GetBookmarkModel(); 689 BookmarkModel* bookmark_model = client_->GetBookmarkModel();
690 if (bookmark_model && bookmark_model->IsBookmarked(match.destination_url)) 690 if (bookmark_model && bookmark_model->IsBookmarked(match.destination_url))
691 client_->OnBookmarkLaunched(); 691 client_->OnBookmarkLaunched();
692 OmniboxFieldTrial::ContextualZeroSuggest::RecordTypeAsUsed(
693 match.specific_type);
692 } 694 }
693 695
694 bool OmniboxEditModel::AcceptKeyword( 696 bool OmniboxEditModel::AcceptKeyword(
695 KeywordModeEntryMethod entry_method) { 697 KeywordModeEntryMethod entry_method) {
696 DCHECK(is_keyword_hint_ && !keyword_.empty()); 698 DCHECK(is_keyword_hint_ && !keyword_.empty());
697 699
698 autocomplete_controller()->Stop(false); 700 autocomplete_controller()->Stop(false);
699 701
700 is_keyword_hint_ = false; 702 is_keyword_hint_ = false;
701 keyword_mode_entry_method_ = entry_method; 703 keyword_mode_entry_method_ = entry_method;
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 // Update state and notify view if the omnibox has focus and the caret 1389 // Update state and notify view if the omnibox has focus and the caret
1388 // visibility changed. 1390 // visibility changed.
1389 const bool was_caret_visible = is_caret_visible(); 1391 const bool was_caret_visible = is_caret_visible();
1390 focus_state_ = state; 1392 focus_state_ = state;
1391 if (focus_state_ != OMNIBOX_FOCUS_NONE && 1393 if (focus_state_ != OMNIBOX_FOCUS_NONE &&
1392 is_caret_visible() != was_caret_visible) 1394 is_caret_visible() != was_caret_visible)
1393 view_->ApplyCaretVisibility(); 1395 view_->ApplyCaretVisibility();
1394 1396
1395 client_->OnFocusChanged(focus_state_, reason); 1397 client_->OnFocusChanged(focus_state_, reason);
1396 } 1398 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698