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

Side by Side Diff: chrome/browser/ui/app_list/start_page_service.cc

Issue 55433002: Propagates the search result of start page to the app-list search box. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/app_list/start_page_service.h" 5 #include "chrome/browser/ui/app_list/start_page_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
11 #include "chrome/browser/chrome_notification_types.h" 11 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/extensions/extension_system_factory.h" 12 #include "chrome/browser/extensions/extension_system_factory.h"
13 #include "chrome/browser/extensions/install_tracker_factory.h" 13 #include "chrome/browser/extensions/install_tracker_factory.h"
14 #include "chrome/browser/media/media_stream_infobar_delegate.h" 14 #include "chrome/browser/media/media_stream_infobar_delegate.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/ui/app_list/recommended_apps.h" 16 #include "chrome/browser/ui/app_list/recommended_apps.h"
17 #include "chrome/browser/ui/app_list/start_page_observer.h"
17 #include "chrome/common/chrome_switches.h" 18 #include "chrome/common/chrome_switches.h"
18 #include "chrome/common/extensions/extension.h" 19 #include "chrome/common/extensions/extension.h"
19 #include "chrome/common/url_constants.h" 20 #include "chrome/common/url_constants.h"
20 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" 21 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
21 #include "components/browser_context_keyed_service/browser_context_keyed_service _factory.h" 22 #include "components/browser_context_keyed_service/browser_context_keyed_service _factory.h"
22 #include "content/public/browser/notification_observer.h" 23 #include "content/public/browser/notification_observer.h"
23 #include "content/public/browser/notification_registrar.h" 24 #include "content/public/browser/notification_registrar.h"
24 #include "content/public/browser/notification_service.h" 25 #include "content/public/browser/notification_service.h"
25 #include "content/public/browser/web_contents.h" 26 #include "content/public/browser/web_contents.h"
26 #include "content/public/browser/web_contents_delegate.h" 27 #include "content/public/browser/web_contents_delegate.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 132
132 contents_->GetController().LoadURL( 133 contents_->GetController().LoadURL(
133 url, 134 url,
134 content::Referrer(), 135 content::Referrer(),
135 content::PAGE_TRANSITION_AUTO_TOPLEVEL, 136 content::PAGE_TRANSITION_AUTO_TOPLEVEL,
136 std::string()); 137 std::string());
137 } 138 }
138 139
139 StartPageService::~StartPageService() {} 140 StartPageService::~StartPageService() {}
140 141
142 void StartPageService::AddObserver(StartPageObserver* observer) {
143 observers_.AddObserver(observer);
144 }
145
146 void StartPageService::RemoveObserver(StartPageObserver* observer) {
147 observers_.RemoveObserver(observer);
148 }
149
150 void StartPageService::OnSearch(const base::string16& query) {
151 FOR_EACH_OBSERVER(StartPageObserver, observers_, OnSearch(query));
152 }
153
141 void StartPageService::Shutdown() { 154 void StartPageService::Shutdown() {
142 contents_.reset(); 155 contents_.reset();
143 } 156 }
144 157
145 } // namespace app_list 158 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service.h ('k') | chrome/browser/ui/webui/app_list/start_page_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698