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

Side by Side Diff: chrome/browser/chromeos/first_run/drive_first_run_controller.cc

Issue 218683011: Remove ExtensionService::[Get|Is]InstalledApp() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dc_ces_get_installed_ext_by_url
Patch Set: Created 6 years, 8 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 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/chromeos/first_run/drive_first_run_controller.h" 5 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray_delegate.h" 8 #include "ash/system/tray/system_tray_delegate.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 14 matching lines...) Expand all
25 #include "content/public/browser/browser_thread.h" 25 #include "content/public/browser/browser_thread.h"
26 #include "content/public/browser/navigation_controller.h" 26 #include "content/public/browser/navigation_controller.h"
27 #include "content/public/browser/notification_details.h" 27 #include "content/public/browser/notification_details.h"
28 #include "content/public/browser/notification_observer.h" 28 #include "content/public/browser/notification_observer.h"
29 #include "content/public/browser/notification_registrar.h" 29 #include "content/public/browser/notification_registrar.h"
30 #include "content/public/browser/notification_source.h" 30 #include "content/public/browser/notification_source.h"
31 #include "content/public/browser/notification_types.h" 31 #include "content/public/browser/notification_types.h"
32 #include "content/public/browser/site_instance.h" 32 #include "content/public/browser/site_instance.h"
33 #include "content/public/browser/web_contents.h" 33 #include "content/public/browser/web_contents.h"
34 #include "content/public/browser/web_contents_observer.h" 34 #include "content/public/browser/web_contents_observer.h"
35 #include "extensions/browser/extension_registry.h"
35 #include "extensions/browser/extension_system.h" 36 #include "extensions/browser/extension_system.h"
36 #include "extensions/common/extension.h" 37 #include "extensions/common/extension.h"
38 #include "extensions/common/extension_set.h"
37 #include "grit/generated_resources.h" 39 #include "grit/generated_resources.h"
38 #include "grit/theme_resources.h" 40 #include "grit/theme_resources.h"
39 #include "ui/base/l10n/l10n_util.h" 41 #include "ui/base/l10n/l10n_util.h"
40 #include "ui/base/resource/resource_bundle.h" 42 #include "ui/base/resource/resource_bundle.h"
41 #include "ui/message_center/message_center.h" 43 #include "ui/message_center/message_center.h"
42 #include "ui/message_center/notification.h" 44 #include "ui/message_center/notification.h"
43 #include "ui/message_center/notification_delegate.h" 45 #include "ui/message_center/notification_delegate.h"
44 #include "url/gurl.h" 46 #include "url/gurl.h"
45 47
46 namespace chromeos { 48 namespace chromeos {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 WindowContainerType window_container_type, 292 WindowContainerType window_container_type,
291 const base::string16& frame_name, 293 const base::string16& frame_name,
292 const GURL& target_url, 294 const GURL& target_url,
293 const std::string& partition_id, 295 const std::string& partition_id,
294 content::SessionStorageNamespace* session_storage_namespace) { 296 content::SessionStorageNamespace* session_storage_namespace) {
295 297
296 if (window_container_type == WINDOW_CONTAINER_TYPE_NORMAL) 298 if (window_container_type == WINDOW_CONTAINER_TYPE_NORMAL)
297 return true; 299 return true;
298 300
299 // Check that the target URL is for the Drive app. 301 // Check that the target URL is for the Drive app.
300 ExtensionService* service = 302 const extensions::Extension* extension =
301 extensions::ExtensionSystem::Get(profile_)->extension_service(); 303 extensions::ExtensionRegistry::Get(profile_)
302 const extensions::Extension *extension = 304 ->enabled_extensions().GetAppByURL(target_url);
303 service->GetInstalledApp(target_url);
304 if (!extension || extension->id() != app_id_) 305 if (!extension || extension->id() != app_id_)
305 return true; 306 return true;
306 307
307 // The background contents creation is normally done in Browser, but 308 // The background contents creation is normally done in Browser, but
308 // because we're using a detached WebContents, we need to do it ourselves. 309 // because we're using a detached WebContents, we need to do it ourselves.
309 BackgroundContentsService* background_contents_service = 310 BackgroundContentsService* background_contents_service =
310 BackgroundContentsServiceFactory::GetForProfile(profile_); 311 BackgroundContentsServiceFactory::GetForProfile(profile_);
311 312
312 // Prevent redirection if background contents already exists. 313 // Prevent redirection if background contents already exists.
313 if (background_contents_service->GetAppBackgroundContents( 314 if (background_contents_service->GetAppBackgroundContents(
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 base::UTF8ToUTF16(extension->name()), 479 base::UTF8ToUTF16(extension->name()),
479 message_center::NotifierId(message_center::NotifierId::APPLICATION, 480 message_center::NotifierId(message_center::NotifierId::APPLICATION,
480 kDriveHostedAppId), 481 kDriveHostedAppId),
481 data, 482 data,
482 new DriveOfflineNotificationDelegate(profile_))); 483 new DriveOfflineNotificationDelegate(profile_)));
483 notification->set_priority(message_center::LOW_PRIORITY); 484 notification->set_priority(message_center::LOW_PRIORITY);
484 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); 485 message_center::MessageCenter::Get()->AddNotification(notification.Pass());
485 } 486 }
486 487
487 } // namespace chromeos 488 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698