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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc

Issue 515563003: Remove dependency of chrome in WebRequestPermissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated. Created 6 years, 3 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/ui/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 10 #include "ash/desktop_background/desktop_background_controller.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #include "chrome/common/url_constants.h" 67 #include "chrome/common/url_constants.h"
68 #include "chrome/grit/generated_resources.h" 68 #include "chrome/grit/generated_resources.h"
69 #include "content/public/browser/navigation_entry.h" 69 #include "content/public/browser/navigation_entry.h"
70 #include "content/public/browser/notification_registrar.h" 70 #include "content/public/browser/notification_registrar.h"
71 #include "content/public/browser/notification_service.h" 71 #include "content/public/browser/notification_service.h"
72 #include "content/public/browser/web_contents.h" 72 #include "content/public/browser/web_contents.h"
73 #include "extensions/browser/extension_prefs.h" 73 #include "extensions/browser/extension_prefs.h"
74 #include "extensions/browser/extension_registry.h" 74 #include "extensions/browser/extension_registry.h"
75 #include "extensions/browser/extension_system.h" 75 #include "extensions/browser/extension_system.h"
76 #include "extensions/browser/extension_util.h" 76 #include "extensions/browser/extension_util.h"
77 #include "extensions/common/constants.h"
77 #include "extensions/common/extension.h" 78 #include "extensions/common/extension.h"
78 #include "extensions/common/extension_resource.h" 79 #include "extensions/common/extension_resource.h"
79 #include "extensions/common/manifest_handlers/icons_handler.h" 80 #include "extensions/common/manifest_handlers/icons_handler.h"
80 #include "extensions/common/url_pattern.h" 81 #include "extensions/common/url_pattern.h"
81 #include "grit/ash_resources.h" 82 #include "grit/ash_resources.h"
82 #include "grit/theme_resources.h" 83 #include "grit/theme_resources.h"
83 #include "net/base/url_util.h" 84 #include "net/base/url_util.h"
84 #include "ui/aura/window.h" 85 #include "ui/aura/window.h"
85 #include "ui/aura/window_event_dispatcher.h" 86 #include "ui/aura/window_event_dispatcher.h"
86 #include "ui/base/l10n/l10n_util.h" 87 #include "ui/base/l10n/l10n_util.h"
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 if (LaunchedInNativeDesktop(app_id)) 731 if (LaunchedInNativeDesktop(app_id))
731 return; 732 return;
732 #endif 733 #endif
733 734
734 // The app will be created for the currently active profile. 735 // The app will be created for the currently active profile.
735 AppLaunchParams params(profile_, 736 AppLaunchParams params(profile_,
736 extension, 737 extension,
737 event_flags, 738 event_flags,
738 chrome::HOST_DESKTOP_TYPE_ASH); 739 chrome::HOST_DESKTOP_TYPE_ASH);
739 if (source != ash::LAUNCH_FROM_UNKNOWN && 740 if (source != ash::LAUNCH_FROM_UNKNOWN &&
740 app_id == extension_misc::kWebStoreAppId) { 741 app_id == extensions::kWebStoreAppId) {
741 // Get the corresponding source string. 742 // Get the corresponding source string.
742 std::string source_value = GetSourceFromAppListSource(source); 743 std::string source_value = GetSourceFromAppListSource(source);
743 744
744 // Set an override URL to include the source. 745 // Set an override URL to include the source.
745 GURL extension_url = extensions::AppLaunchInfo::GetFullLaunchURL(extension); 746 GURL extension_url = extensions::AppLaunchInfo::GetFullLaunchURL(extension);
746 params.override_url = net::AppendQueryParameter( 747 params.override_url = net::AppendQueryParameter(
747 extension_url, extension_urls::kWebstoreSourceField, source_value); 748 extension_url, extension_urls::kWebstoreSourceField, source_value);
748 } 749 }
749 750
750 OpenApplication(params); 751 OpenApplication(params);
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2094 } 2095 }
2095 2096
2096 void ChromeLauncherController::ReleaseProfile() { 2097 void ChromeLauncherController::ReleaseProfile() {
2097 if (app_sync_ui_state_) 2098 if (app_sync_ui_state_)
2098 app_sync_ui_state_->RemoveObserver(this); 2099 app_sync_ui_state_->RemoveObserver(this);
2099 2100
2100 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); 2101 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this);
2101 2102
2102 pref_change_registrar_.RemoveAll(); 2103 pref_change_registrar_.RemoveAll();
2103 } 2104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698