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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "apps/custom_launcher_page_contents.h" | 11 #include "apps/custom_launcher_page_contents.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/metrics/user_metrics.h" | 15 #include "base/metrics/user_metrics.h" |
16 #include "base/profiler/scoped_tracker.h" | 16 #include "base/profiler/scoped_tracker.h" |
17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "chrome/browser/apps/scoped_keep_alive.h" | |
20 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/chrome_notification_types.h" | 20 #include "chrome/browser/chrome_notification_types.h" |
21 #include "chrome/browser/lifetime/scoped_keep_alive.h" | |
22 #include "chrome/browser/profiles/profile_attributes_entry.h" | 22 #include "chrome/browser/profiles/profile_attributes_entry.h" |
23 #include "chrome/browser/profiles/profile_attributes_storage.h" | 23 #include "chrome/browser/profiles/profile_attributes_storage.h" |
24 #include "chrome/browser/profiles/profile_manager.h" | 24 #include "chrome/browser/profiles/profile_manager.h" |
25 #include "chrome/browser/search/hotword_service.h" | 25 #include "chrome/browser/search/hotword_service.h" |
26 #include "chrome/browser/search/hotword_service_factory.h" | 26 #include "chrome/browser/search/hotword_service_factory.h" |
27 #include "chrome/browser/search_engines/template_url_service_factory.h" | 27 #include "chrome/browser/search_engines/template_url_service_factory.h" |
28 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 28 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
29 #include "chrome/browser/ui/app_list/app_list_service.h" | 29 #include "chrome/browser/ui/app_list/app_list_service.h" |
30 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 30 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
31 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 31 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
343 GetCustomLauncherPageUrls(profile_, &custom_launcher_page_urls); | 343 GetCustomLauncherPageUrls(profile_, &custom_launcher_page_urls); |
344 if (custom_launcher_page_urls.empty()) | 344 if (custom_launcher_page_urls.empty()) |
345 return; | 345 return; |
346 | 346 |
347 for (std::vector<GURL>::const_iterator it = custom_launcher_page_urls.begin(); | 347 for (std::vector<GURL>::const_iterator it = custom_launcher_page_urls.begin(); |
348 it != custom_launcher_page_urls.end(); | 348 it != custom_launcher_page_urls.end(); |
349 ++it) { | 349 ++it) { |
350 std::string extension_id = it->host(); | 350 std::string extension_id = it->host(); |
351 apps::CustomLauncherPageContents* page_contents = | 351 apps::CustomLauncherPageContents* page_contents = |
352 new apps::CustomLauncherPageContents( | 352 new apps::CustomLauncherPageContents( |
353 scoped_ptr<extensions::AppDelegate>( | 353 scoped_ptr<extensions::AppDelegate>(new ChromeAppDelegate( |
Bernhard Bauer
2016/02/19 17:39:28
Y'know, I'm thinking that ChromeAppDelegate should
dgn
2016/02/19 19:14:23
Hum.. what about the optimization flags in that ca
dgn
2016/02/22 18:01:19
Done.
| |
354 new ChromeAppDelegate(scoped_ptr<ScopedKeepAlive>())), | 354 make_scoped_ptr(new ScopedKeepAlive("ChromeAppDelegate")))), |
Bernhard Bauer
2016/02/19 17:39:28
Urr, this was a null pointer, no? (I.e. no keep al
dgn
2016/02/19 18:04:28
Done in Patch 4
| |
355 extension_id); | 355 extension_id); |
356 page_contents->Initialize(profile_, *it); | 356 page_contents->Initialize(profile_, *it); |
357 custom_page_contents_.push_back(page_contents); | 357 custom_page_contents_.push_back(page_contents); |
358 } | 358 } |
359 | 359 |
360 std::string first_launcher_page_app_id = custom_launcher_page_urls[0].host(); | 360 std::string first_launcher_page_app_id = custom_launcher_page_urls[0].host(); |
361 const extensions::Extension* extension = | 361 const extensions::Extension* extension = |
362 extensions::ExtensionRegistry::Get(profile_) | 362 extensions::ExtensionRegistry::Get(profile_) |
363 ->GetExtensionById(first_launcher_page_app_id, | 363 ->GetExtensionById(first_launcher_page_app_id, |
364 extensions::ExtensionRegistry::EVERYTHING); | 364 extensions::ExtensionRegistry::EVERYTHING); |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
822 | 822 |
823 // SigninManagerFactory is not a leaky singleton (unlike this class), and | 823 // SigninManagerFactory is not a leaky singleton (unlike this class), and |
824 // its destructor will check that it has no remaining observers. | 824 // its destructor will check that it has no remaining observers. |
825 scoped_observer_.RemoveAll(); | 825 scoped_observer_.RemoveAll(); |
826 SigninManagerFactory::GetInstance()->RemoveObserver(this); | 826 SigninManagerFactory::GetInstance()->RemoveObserver(this); |
827 break; | 827 break; |
828 default: | 828 default: |
829 NOTREACHED(); | 829 NOTREACHED(); |
830 } | 830 } |
831 } | 831 } |
OLD | NEW |