| OLD | NEW |
| 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/omnibox/omnibox_edit_model.h" | 5 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "chrome/common/chrome_notification_types.h" | 48 #include "chrome/common/chrome_notification_types.h" |
| 49 #include "chrome/common/chrome_switches.h" | 49 #include "chrome/common/chrome_switches.h" |
| 50 #include "chrome/common/pref_names.h" | 50 #include "chrome/common/pref_names.h" |
| 51 #include "chrome/common/url_constants.h" | 51 #include "chrome/common/url_constants.h" |
| 52 #include "content/public/browser/notification_service.h" | 52 #include "content/public/browser/notification_service.h" |
| 53 #include "content/public/browser/render_view_host.h" | 53 #include "content/public/browser/render_view_host.h" |
| 54 #include "content/public/browser/user_metrics.h" | 54 #include "content/public/browser/user_metrics.h" |
| 55 #include "content/public/browser/web_contents.h" | 55 #include "content/public/browser/web_contents.h" |
| 56 #include "content/public/browser/web_contents_view.h" | 56 #include "content/public/browser/web_contents_view.h" |
| 57 #include "googleurl/src/url_util.h" | 57 #include "googleurl/src/url_util.h" |
| 58 #include "third_party/skia/include/core/SkBitmap.h" | 58 #include "ui/gfx/image/image.h" |
| 59 | 59 |
| 60 using content::UserMetricsAction; | 60 using content::UserMetricsAction; |
| 61 using predictors::AutocompleteActionPredictor; | 61 using predictors::AutocompleteActionPredictor; |
| 62 using predictors::AutocompleteActionPredictorFactory; | 62 using predictors::AutocompleteActionPredictorFactory; |
| 63 | 63 |
| 64 /////////////////////////////////////////////////////////////////////////////// | 64 /////////////////////////////////////////////////////////////////////////////// |
| 65 // OmniboxEditModel::State | 65 // OmniboxEditModel::State |
| 66 | 66 |
| 67 OmniboxEditModel::State::State(bool user_input_in_progress, | 67 OmniboxEditModel::State::State(bool user_input_in_progress, |
| 68 const string16& user_text, | 68 const string16& user_text, |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 268 |
| 269 // No need to wait any longer for instant. | 269 // No need to wait any longer for instant. |
| 270 FinalizeInstantQuery(string16(), string16(), false); | 270 FinalizeInstantQuery(string16(), string16(), false); |
| 271 } | 271 } |
| 272 | 272 |
| 273 controller_->OnChanged(); | 273 controller_->OnChanged(); |
| 274 } | 274 } |
| 275 | 275 |
| 276 void OmniboxEditModel::GetDataForURLExport(GURL* url, | 276 void OmniboxEditModel::GetDataForURLExport(GURL* url, |
| 277 string16* title, | 277 string16* title, |
| 278 SkBitmap* favicon) { | 278 gfx::Image* favicon) { |
| 279 AutocompleteMatch match; | 279 AutocompleteMatch match; |
| 280 GetInfoForCurrentText(&match, NULL); | 280 GetInfoForCurrentText(&match, NULL); |
| 281 *url = match.destination_url; | 281 *url = match.destination_url; |
| 282 if (*url == URLFixerUpper::FixupURL(UTF16ToUTF8(permanent_text_), | 282 if (*url == URLFixerUpper::FixupURL(UTF16ToUTF8(permanent_text_), |
| 283 std::string())) { | 283 std::string())) { |
| 284 *title = controller_->GetTitle(); | 284 *title = controller_->GetTitle(); |
| 285 *favicon = controller_->GetFavicon(); | 285 *favicon = controller_->GetFavicon(); |
| 286 } | 286 } |
| 287 } | 287 } |
| 288 | 288 |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1212 } | 1212 } |
| 1213 | 1213 |
| 1214 void OmniboxEditModel::ClassifyStringForPasteAndGo( | 1214 void OmniboxEditModel::ClassifyStringForPasteAndGo( |
| 1215 const string16& text, | 1215 const string16& text, |
| 1216 AutocompleteMatch* match, | 1216 AutocompleteMatch* match, |
| 1217 GURL* alternate_nav_url) const { | 1217 GURL* alternate_nav_url) const { |
| 1218 DCHECK(match); | 1218 DCHECK(match); |
| 1219 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, | 1219 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, |
| 1220 string16(), false, false, match, alternate_nav_url); | 1220 string16(), false, false, match, alternate_nav_url); |
| 1221 } | 1221 } |
| OLD | NEW |