OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_process_manager.h" | 5 #include "chrome/browser/extensions/extension_process_manager.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser_window.h" | 7 #include "chrome/browser/ui/browser_window.h" |
8 #include "content/browser/browsing_instance.h" | 8 #include "content/browser/browsing_instance.h" |
9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
10 #include "chrome/browser/extensions/extension_host_mac.h" | 10 #include "chrome/browser/extensions/extension_host_mac.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // Force the options page to open in non-OTR window, because it won't be | 201 // Force the options page to open in non-OTR window, because it won't be |
202 // able to save settings from OTR. | 202 // able to save settings from OTR. |
203 if (!browser || browser->profile()->IsOffTheRecord()) { | 203 if (!browser || browser->profile()->IsOffTheRecord()) { |
204 Profile* profile = | 204 Profile* profile = |
205 Profile::FromBrowserContext(browsing_instance_->browser_context()); | 205 Profile::FromBrowserContext(browsing_instance_->browser_context()); |
206 browser = Browser::GetOrCreateTabbedBrowser(profile->GetOriginalProfile()); | 206 browser = Browser::GetOrCreateTabbedBrowser(profile->GetOriginalProfile()); |
207 } | 207 } |
208 | 208 |
209 browser->OpenURL(extension->options_url(), GURL(), SINGLETON_TAB, | 209 browser->OpenURL(extension->options_url(), GURL(), SINGLETON_TAB, |
210 PageTransition::LINK); | 210 PageTransition::LINK); |
211 browser->window()->Show(); | 211 browser->window()->Show(BrowserWindow::SHOW_CONTEXT_NORMAL); |
212 static_cast<RenderViewHostDelegate*>(browser->GetSelectedTabContents())-> | 212 static_cast<RenderViewHostDelegate*>(browser->GetSelectedTabContents())-> |
213 Activate(); | 213 Activate(); |
214 } | 214 } |
215 | 215 |
216 ExtensionHost* ExtensionProcessManager::GetBackgroundHostForExtension( | 216 ExtensionHost* ExtensionProcessManager::GetBackgroundHostForExtension( |
217 const Extension* extension) { | 217 const Extension* extension) { |
218 for (ExtensionHostSet::iterator iter = background_hosts_.begin(); | 218 for (ExtensionHostSet::iterator iter = background_hosts_.begin(); |
219 iter != background_hosts_.end(); ++iter) { | 219 iter != background_hosts_.end(); ++iter) { |
220 ExtensionHost* host = *iter; | 220 ExtensionHost* host = *iter; |
221 if (host->extension() == extension) | 221 if (host->extension() == extension) |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 if (service && service->is_ready()) | 484 if (service && service->is_ready()) |
485 CreateBackgroundHosts(this, service->extensions()); | 485 CreateBackgroundHosts(this, service->extensions()); |
486 } | 486 } |
487 break; | 487 break; |
488 } | 488 } |
489 default: | 489 default: |
490 ExtensionProcessManager::Observe(type, source, details); | 490 ExtensionProcessManager::Observe(type, source, details); |
491 break; | 491 break; |
492 } | 492 } |
493 } | 493 } |
OLD | NEW |