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

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

Issue 1708343002: Add ScopedKeepAlive to c/b/lifetime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove KeepAliveOrigin::TEST Created 4 years, 10 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
OLDNEW
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
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(false)),
354 new ChromeAppDelegate(scoped_ptr<ScopedKeepAlive>())),
355 extension_id); 354 extension_id);
356 page_contents->Initialize(profile_, *it); 355 page_contents->Initialize(profile_, *it);
357 custom_page_contents_.push_back(page_contents); 356 custom_page_contents_.push_back(page_contents);
358 } 357 }
359 358
360 std::string first_launcher_page_app_id = custom_launcher_page_urls[0].host(); 359 std::string first_launcher_page_app_id = custom_launcher_page_urls[0].host();
361 const extensions::Extension* extension = 360 const extensions::Extension* extension =
362 extensions::ExtensionRegistry::Get(profile_) 361 extensions::ExtensionRegistry::Get(profile_)
363 ->GetExtensionById(first_launcher_page_app_id, 362 ->GetExtensionById(first_launcher_page_app_id,
364 extensions::ExtensionRegistry::EVERYTHING); 363 extensions::ExtensionRegistry::EVERYTHING);
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 821
823 // SigninManagerFactory is not a leaky singleton (unlike this class), and 822 // SigninManagerFactory is not a leaky singleton (unlike this class), and
824 // its destructor will check that it has no remaining observers. 823 // its destructor will check that it has no remaining observers.
825 scoped_observer_.RemoveAll(); 824 scoped_observer_.RemoveAll();
826 SigninManagerFactory::GetInstance()->RemoveObserver(this); 825 SigninManagerFactory::GetInstance()->RemoveObserver(this);
827 break; 826 break;
828 default: 827 default:
829 NOTREACHED(); 828 NOTREACHED();
830 } 829 }
831 } 830 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_shower_views_unittest.cc ('k') | chrome/browser/ui/app_list/profile_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698