OLD | NEW |
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_factory.h" | 7 #include "athena/activity/public/activity_factory.h" |
8 #include "athena/activity/public/activity_manager.h" | 8 #include "athena/activity/public/activity_manager.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 UpdateIcon(); | 176 UpdateIcon(); |
177 UpdateTitleAndDetails(); | 177 UpdateTitleAndDetails(); |
178 } | 178 } |
179 | 179 |
180 virtual ~UrlSearchResult() {} | 180 virtual ~UrlSearchResult() {} |
181 | 181 |
182 private: | 182 private: |
183 // Overriddenn from app_list::SearchResult: | 183 // Overriddenn from app_list::SearchResult: |
184 virtual void Open(int event_flags) OVERRIDE { | 184 virtual void Open(int event_flags) OVERRIDE { |
185 ActivityManager::Get()->AddActivity( | 185 ActivityManager::Get()->AddActivity( |
186 ActivityFactory::Get()->CreateWebActivity(browser_context_, | 186 ActivityFactory::Get()->CreateWebActivity( |
187 match_.destination_url)); | 187 browser_context_, base::string16(), match_.destination_url)); |
188 } | 188 } |
189 | 189 |
190 void UpdateIcon() { | 190 void UpdateIcon() { |
191 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 191 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
192 AutocompleteMatch::TypeToIcon(match_.type))); | 192 AutocompleteMatch::TypeToIcon(match_.type))); |
193 } | 193 } |
194 | 194 |
195 void UpdateTitleAndDetails() { | 195 void UpdateTitleAndDetails() { |
196 set_title(match_.contents); | 196 set_title(match_.contents); |
197 SearchResult::Tags title_tags; | 197 SearchResult::Tags title_tags; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 ++it) { | 271 ++it) { |
272 if (!it->destination_url.is_valid()) | 272 if (!it->destination_url.is_valid()) |
273 continue; | 273 continue; |
274 | 274 |
275 Add(scoped_ptr<app_list::SearchResult>(new UrlSearchResult( | 275 Add(scoped_ptr<app_list::SearchResult>(new UrlSearchResult( |
276 browser_context_, *it))); | 276 browser_context_, *it))); |
277 } | 277 } |
278 } | 278 } |
279 | 279 |
280 } // namespace athena | 280 } // namespace athena |
OLD | NEW |