| 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/app_list/app_list_view_delegate.h" | 5 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "apps/custom_launcher_page_contents.h" | 9 #include "apps/custom_launcher_page_contents.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 // Set up the custom launcher pages. | 200 // Set up the custom launcher pages. |
| 201 std::vector<GURL> custom_launcher_page_urls; | 201 std::vector<GURL> custom_launcher_page_urls; |
| 202 GetCustomLauncherPageUrls(profile, &custom_launcher_page_urls); | 202 GetCustomLauncherPageUrls(profile, &custom_launcher_page_urls); |
| 203 for (std::vector<GURL>::const_iterator it = custom_launcher_page_urls.begin(); | 203 for (std::vector<GURL>::const_iterator it = custom_launcher_page_urls.begin(); |
| 204 it != custom_launcher_page_urls.end(); | 204 it != custom_launcher_page_urls.end(); |
| 205 ++it) { | 205 ++it) { |
| 206 std::string extension_id = it->host(); | 206 std::string extension_id = it->host(); |
| 207 apps::CustomLauncherPageContents* page_contents = | 207 apps::CustomLauncherPageContents* page_contents = |
| 208 new apps::CustomLauncherPageContents( | 208 new apps::CustomLauncherPageContents( |
| 209 scoped_ptr<apps::AppDelegate>(new ChromeAppDelegate), extension_id); | 209 scoped_ptr<extensions::AppDelegate>(new ChromeAppDelegate), |
| 210 extension_id); |
| 210 page_contents->Initialize(profile, *it); | 211 page_contents->Initialize(profile, *it); |
| 211 custom_page_contents_.push_back(page_contents); | 212 custom_page_contents_.push_back(page_contents); |
| 212 } | 213 } |
| 213 } | 214 } |
| 214 | 215 |
| 215 AppListViewDelegate::~AppListViewDelegate() { | 216 AppListViewDelegate::~AppListViewDelegate() { |
| 216 app_list::StartPageService* service = | 217 app_list::StartPageService* service = |
| 217 app_list::StartPageService::Get(profile_); | 218 app_list::StartPageService::Get(profile_); |
| 218 if (service) | 219 if (service) |
| 219 service->RemoveObserver(this); | 220 service->RemoveObserver(this); |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 | 583 |
| 583 void AppListViewDelegate::AddObserver( | 584 void AppListViewDelegate::AddObserver( |
| 584 app_list::AppListViewDelegateObserver* observer) { | 585 app_list::AppListViewDelegateObserver* observer) { |
| 585 observers_.AddObserver(observer); | 586 observers_.AddObserver(observer); |
| 586 } | 587 } |
| 587 | 588 |
| 588 void AppListViewDelegate::RemoveObserver( | 589 void AppListViewDelegate::RemoveObserver( |
| 589 app_list::AppListViewDelegateObserver* observer) { | 590 app_list::AppListViewDelegateObserver* observer) { |
| 590 observers_.RemoveObserver(observer); | 591 observers_.RemoveObserver(observer); |
| 591 } | 592 } |
| OLD | NEW |