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

Side by Side Diff: athena/main/url_search_provider.cc

Issue 621823004: Simplifies the structure of app_list search a bit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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
« no previous file with comments | « athena/home/app_list_view_delegate.cc ('k') | chrome/browser/ui/app_list/search/app_result.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "athena/main/url_search_provider.h" 5 #include "athena/main/url_search_provider.h"
6 6
7 #include "athena/activity/public/activity.h" 7 #include "athena/activity/public/activity.h"
8 #include "athena/activity/public/activity_factory.h" 8 #include "athena/activity/public/activity_factory.h"
9 #include "athena/content/public/scheme_classifier_factory.h" 9 #include "athena/content/public/scheme_classifier_factory.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // See comments in autocomplete_provider.h. 163 // See comments in autocomplete_provider.h.
164 set_relevance(match_.relevance / 1500.0); 164 set_relevance(match_.relevance / 1500.0);
165 165
166 UpdateIcon(); 166 UpdateIcon();
167 UpdateTitleAndDetails(); 167 UpdateTitleAndDetails();
168 } 168 }
169 169
170 virtual ~UrlSearchResult() {} 170 virtual ~UrlSearchResult() {}
171 171
172 private: 172 private:
173 // Overriddenn from app_list::SearchResult: 173 // Overridden from app_list::SearchResult:
174 virtual scoped_ptr<app_list::SearchResult> Duplicate() override {
175 return make_scoped_ptr(new UrlSearchResult(browser_context_, match_));
176 }
177
174 virtual void Open(int event_flags) override { 178 virtual void Open(int event_flags) override {
175 Activity* activity = ActivityFactory::Get()->CreateWebActivity( 179 Activity* activity = ActivityFactory::Get()->CreateWebActivity(
176 browser_context_, base::string16(), match_.destination_url); 180 browser_context_, base::string16(), match_.destination_url);
177 Activity::Show(activity); 181 Activity::Show(activity);
178 } 182 }
179 183
180 void UpdateIcon() { 184 void UpdateIcon() {
181 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 185 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
182 AutocompleteMatch::TypeToIcon(match_.type))); 186 AutocompleteMatch::TypeToIcon(match_.type)));
183 } 187 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 ++it) { 281 ++it) {
278 if (!it->destination_url.is_valid()) 282 if (!it->destination_url.is_valid())
279 continue; 283 continue;
280 284
281 Add(scoped_ptr<app_list::SearchResult>(new UrlSearchResult( 285 Add(scoped_ptr<app_list::SearchResult>(new UrlSearchResult(
282 browser_context_, *it))); 286 browser_context_, *it)));
283 } 287 }
284 } 288 }
285 289
286 } // namespace athena 290 } // namespace athena
OLDNEW
« no previous file with comments | « athena/home/app_list_view_delegate.cc ('k') | chrome/browser/ui/app_list/search/app_result.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698