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

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

Issue 1376063005: Cleanup: Pull some browser keep alive functions into its own file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 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 <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"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/metrics/user_metrics.h" 13 #include "base/metrics/user_metrics.h"
14 #include "base/prefs/pref_service.h" 14 #include "base/prefs/pref_service.h"
15 #include "base/profiler/scoped_tracker.h" 15 #include "base/profiler/scoped_tracker.h"
16 #include "base/stl_util.h" 16 #include "base/stl_util.h"
17 #include "chrome/browser/apps/scoped_keep_alive.h"
18 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
19 #include "chrome/browser/chrome_notification_types.h" 18 #include "chrome/browser/chrome_notification_types.h"
19 #include "chrome/browser/lifetime/browser_keep_alive.h"
20 #include "chrome/browser/profiles/profile_info_cache.h" 20 #include "chrome/browser/profiles/profile_info_cache.h"
21 #include "chrome/browser/profiles/profile_manager.h" 21 #include "chrome/browser/profiles/profile_manager.h"
22 #include "chrome/browser/search/hotword_service.h" 22 #include "chrome/browser/search/hotword_service.h"
23 #include "chrome/browser/search/hotword_service_factory.h" 23 #include "chrome/browser/search/hotword_service_factory.h"
24 #include "chrome/browser/search_engines/template_url_service_factory.h" 24 #include "chrome/browser/search_engines/template_url_service_factory.h"
25 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 25 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
26 #include "chrome/browser/ui/app_list/app_list_service.h" 26 #include "chrome/browser/ui/app_list/app_list_service.h"
27 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" 27 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
28 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" 28 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
29 #include "chrome/browser/ui/app_list/launcher_page_event_dispatcher.h" 29 #include "chrome/browser/ui/app_list/launcher_page_event_dispatcher.h"
(...skipping 28 matching lines...) Expand all
58 #include "extensions/common/manifest_handlers/launcher_page_info.h" 58 #include "extensions/common/manifest_handlers/launcher_page_info.h"
59 #include "grit/theme_resources.h" 59 #include "grit/theme_resources.h"
60 #include "ui/app_list/app_list_switches.h" 60 #include "ui/app_list/app_list_switches.h"
61 #include "ui/app_list/app_list_view_delegate_observer.h" 61 #include "ui/app_list/app_list_view_delegate_observer.h"
62 #include "ui/app_list/search_box_model.h" 62 #include "ui/app_list/search_box_model.h"
63 #include "ui/app_list/search_controller.h" 63 #include "ui/app_list/search_controller.h"
64 #include "ui/app_list/speech_ui_model.h" 64 #include "ui/app_list/speech_ui_model.h"
65 #include "ui/base/resource/resource_bundle.h" 65 #include "ui/base/resource/resource_bundle.h"
66 #include "ui/views/controls/webview/webview.h" 66 #include "ui/views/controls/webview/webview.h"
67 67
68 #if defined(TOOLKIT_VIEWS)
69 #include "ui/views/controls/webview/webview.h"
70 #endif
71
72 #if defined(USE_AURA) 68 #if defined(USE_AURA)
73 #include "ui/keyboard/keyboard_util.h" 69 #include "ui/keyboard/keyboard_util.h"
74 #endif 70 #endif
75 71
76 #if defined(USE_ASH) 72 #if defined(USE_ASH)
77 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" 73 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h"
78 #endif 74 #endif
79 75
80 #if defined(OS_WIN) 76 #if defined(OS_WIN)
81 #include "chrome/browser/web_applications/web_app_win.h" 77 #include "chrome/browser/web_applications/web_app_win.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 if (custom_launcher_page_urls.empty()) 336 if (custom_launcher_page_urls.empty())
341 return; 337 return;
342 338
343 for (std::vector<GURL>::const_iterator it = custom_launcher_page_urls.begin(); 339 for (std::vector<GURL>::const_iterator it = custom_launcher_page_urls.begin();
344 it != custom_launcher_page_urls.end(); 340 it != custom_launcher_page_urls.end();
345 ++it) { 341 ++it) {
346 std::string extension_id = it->host(); 342 std::string extension_id = it->host();
347 apps::CustomLauncherPageContents* page_contents = 343 apps::CustomLauncherPageContents* page_contents =
348 new apps::CustomLauncherPageContents( 344 new apps::CustomLauncherPageContents(
349 scoped_ptr<extensions::AppDelegate>( 345 scoped_ptr<extensions::AppDelegate>(
350 new ChromeAppDelegate(scoped_ptr<ScopedKeepAlive>())), 346 new ChromeAppDelegate(
347 scoped_ptr<browser_lifetime::ScopedKeepAlive>())),
351 extension_id); 348 extension_id);
352 page_contents->Initialize(profile_, *it); 349 page_contents->Initialize(profile_, *it);
353 custom_page_contents_.push_back(page_contents); 350 custom_page_contents_.push_back(page_contents);
354 } 351 }
355 352
356 std::string first_launcher_page_app_id = custom_launcher_page_urls[0].host(); 353 std::string first_launcher_page_app_id = custom_launcher_page_urls[0].host();
357 const extensions::Extension* extension = 354 const extensions::Extension* extension =
358 extensions::ExtensionRegistry::Get(profile_) 355 extensions::ExtensionRegistry::Get(profile_)
359 ->GetExtensionById(first_launcher_page_app_id, 356 ->GetExtensionById(first_launcher_page_app_id,
360 extensions::ExtensionRegistry::EVERYTHING); 357 extensions::ExtensionRegistry::EVERYTHING);
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 812
816 // SigninManagerFactory is not a leaky singleton (unlike this class), and 813 // SigninManagerFactory is not a leaky singleton (unlike this class), and
817 // its destructor will check that it has no remaining observers. 814 // its destructor will check that it has no remaining observers.
818 scoped_observer_.RemoveAll(); 815 scoped_observer_.RemoveAll();
819 SigninManagerFactory::GetInstance()->RemoveObserver(this); 816 SigninManagerFactory::GetInstance()->RemoveObserver(this);
820 break; 817 break;
821 default: 818 default:
822 NOTREACHED(); 819 NOTREACHED();
823 } 820 }
824 } 821 }
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.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698