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

Side by Side Diff: chrome/browser/ui/search/search_tab_helper.cc

Issue 10787028: Converts SearchViewController to use live NTP content instead of placeholder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/ui/search/search_tab_helper.h" 5 #include "chrome/browser/ui/search/search_tab_helper.h"
6 6
7 #include "chrome/browser/google/google_util.h" 7 #include "chrome/browser/google/google_util.h"
8 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" 8 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h"
9 #include "chrome/browser/ui/search/search_model.h" 9 #include "chrome/browser/ui/search/search_model.h"
10 #include "chrome/browser/ui/tab_contents/tab_contents.h" 10 #include "chrome/browser/ui/tab_contents/tab_contents.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 if (model_->mode().is_ntp()) { 54 if (model_->mode().is_ntp()) {
55 if (edit_model->user_input_in_progress()) 55 if (edit_model->user_input_in_progress())
56 model_->SetMode(Mode(Mode::MODE_SEARCH, true)); 56 model_->SetMode(Mode(Mode::MODE_SEARCH, true));
57 return; 57 return;
58 } 58 }
59 59
60 Mode::Type mode = Mode::MODE_DEFAULT; 60 Mode::Type mode = Mode::MODE_DEFAULT;
61 GURL url(web_contents()->GetURL()); 61 GURL url(web_contents()->GetURL());
62 if (google_util::IsInstantExtendedAPIGoogleSearchUrl(url.spec()) || 62 if (google_util::IsInstantExtendedAPIGoogleSearchUrl(url.spec()) ||
63 edit_model->has_focus()) { 63 (edit_model->has_focus() && edit_model->user_input_in_progress())) {
dhollowa 2012/07/20 00:34:09 Until zero-suggest lands, the presence of the sugg
64 mode = Mode::MODE_SEARCH; 64 mode = Mode::MODE_SEARCH;
65 } 65 }
66 model_->SetMode(Mode(mode, true)); 66 model_->SetMode(Mode(mode, true));
67 } 67 }
68 68
69 void SearchTabHelper::NavigateToPendingEntry( 69 void SearchTabHelper::NavigateToPendingEntry(
70 const GURL& url, 70 const GURL& url,
71 content::NavigationController::ReloadType reload_type) { 71 content::NavigationController::ReloadType reload_type) {
72 if (!is_search_enabled_) 72 if (!is_search_enabled_)
73 return; 73 return;
(...skipping 15 matching lines...) Expand all
89 Mode::Type type = Mode::MODE_DEFAULT; 89 Mode::Type type = Mode::MODE_DEFAULT;
90 if (IsNTP(url)) 90 if (IsNTP(url))
91 type = Mode::MODE_NTP; 91 type = Mode::MODE_NTP;
92 else if (google_util::IsInstantExtendedAPIGoogleSearchUrl(url.spec())) 92 else if (google_util::IsInstantExtendedAPIGoogleSearchUrl(url.spec()))
93 type = Mode::MODE_SEARCH; 93 type = Mode::MODE_SEARCH;
94 model_->SetMode(Mode(type, true)); 94 model_->SetMode(Mode(type, true));
95 } 95 }
96 96
97 } // namespace search 97 } // namespace search
98 } // namespace chrome 98 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_view.cc » ('j') | chrome/browser/ui/views/search_view_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698