| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/webui/options/website_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/website_settings_handler.h" |
| 6 | 6 |
| 7 #include "apps/app_window_registry.h" | |
| 8 #include "chrome/browser/content_settings/content_settings_utils.h" | 7 #include "chrome/browser/content_settings/content_settings_utils.h" |
| 9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/browser/ui/browser_iterator.h" | 12 #include "chrome/browser/ui/browser_iterator.h" |
| 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 15 #include "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
| 16 #include "components/power/origin_power_map.h" | 15 #include "components/power/origin_power_map.h" |
| 17 #include "components/power/origin_power_map_factory.h" | 16 #include "components/power/origin_power_map_factory.h" |
| 18 #include "content/public/browser/dom_storage_context.h" | 17 #include "content/public/browser/dom_storage_context.h" |
| 19 #include "content/public/browser/storage_partition.h" | 18 #include "content/public/browser/storage_partition.h" |
| 20 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
| 21 #include "content/public/browser/web_ui.h" | 20 #include "content/public/browser/web_ui.h" |
| 21 #include "extensions/browser/app_window/app_window_registry.h" |
| 22 #include "extensions/browser/extension_registry.h" | 22 #include "extensions/browser/extension_registry.h" |
| 23 #include "extensions/browser/extension_system.h" | 23 #include "extensions/browser/extension_system.h" |
| 24 #include "extensions/common/constants.h" | 24 #include "extensions/common/constants.h" |
| 25 #include "extensions/common/extension.h" | 25 #include "extensions/common/extension.h" |
| 26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 27 #include "ui/base/l10n/time_format.h" | 27 #include "ui/base/l10n/time_format.h" |
| 28 #include "ui/base/text/bytes_formatting.h" | 28 #include "ui/base/text/bytes_formatting.h" |
| 29 | 29 |
| 30 using power::OriginPowerMap; | 30 using power::OriginPowerMap; |
| 31 using power::OriginPowerMapFactory; | 31 using power::OriginPowerMapFactory; |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 } | 530 } |
| 531 | 531 |
| 532 void WebsiteSettingsHandler::StopOrigin(const GURL& site_url) { | 532 void WebsiteSettingsHandler::StopOrigin(const GURL& site_url) { |
| 533 Profile* profile = Profile::FromWebUI(web_ui()); | 533 Profile* profile = Profile::FromWebUI(web_ui()); |
| 534 if (site_url.SchemeIs(extensions::kExtensionScheme)) { | 534 if (site_url.SchemeIs(extensions::kExtensionScheme)) { |
| 535 const extensions::Extension* extension = | 535 const extensions::Extension* extension = |
| 536 extensions::ExtensionRegistry::Get(profile) | 536 extensions::ExtensionRegistry::Get(profile) |
| 537 ->enabled_extensions() | 537 ->enabled_extensions() |
| 538 .GetHostedAppByURL(site_url); | 538 .GetHostedAppByURL(site_url); |
| 539 if (extension) { | 539 if (extension) { |
| 540 apps::AppWindowRegistry::Get(profile) | 540 extensions::AppWindowRegistry::Get(profile) |
| 541 ->CloseAllAppWindowsForApp(extension->id()); | 541 ->CloseAllAppWindowsForApp(extension->id()); |
| 542 } | 542 } |
| 543 } | 543 } |
| 544 | 544 |
| 545 for (chrome::BrowserIterator it; !it.done(); it.Next()) { | 545 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
| 546 Browser* browser = *it; | 546 Browser* browser = *it; |
| 547 TabStripModel* model = browser->tab_strip_model(); | 547 TabStripModel* model = browser->tab_strip_model(); |
| 548 for (int idx = 0; idx < model->count(); idx++) { | 548 for (int idx = 0; idx < model->count(); idx++) { |
| 549 content::WebContents* web_contents = model->GetWebContentsAt(idx); | 549 content::WebContents* web_contents = model->GetWebContentsAt(idx); |
| 550 // Can't discard tabs that are already discarded or active. | 550 // Can't discard tabs that are already discarded or active. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // If extension is NULL, it was removed and we cannot look up its name. | 589 // If extension is NULL, it was removed and we cannot look up its name. |
| 590 if (!extension) | 590 if (!extension) |
| 591 return site_url.spec(); | 591 return site_url.spec(); |
| 592 | 592 |
| 593 return extension->name(); | 593 return extension->name(); |
| 594 } | 594 } |
| 595 return site_url.spec(); | 595 return site_url.spec(); |
| 596 } | 596 } |
| 597 | 597 |
| 598 } // namespace options | 598 } // namespace options |
| OLD | NEW |