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

Side by Side Diff: chrome/browser/ui/webui/options/website_settings_handler.cc

Issue 494033002: Move AppWindow to extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unneeded include in chrome_shell_delegate.cc 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/options/options_handlers_helper.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/options_handlers_helper.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698