OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/view_type_utils.h" | 22 #include "chrome/browser/view_type_utils.h" |
23 #include "chrome/common/chrome_notification_types.h" | 23 #include "chrome/common/chrome_notification_types.h" |
24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/extensions/extension.h" | 25 #include "chrome/common/extensions/extension.h" |
26 #include "chrome/common/extensions/extension_messages.h" | 26 #include "chrome/common/extensions/extension_messages.h" |
27 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
28 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
29 #include "content/public/browser/notification_service.h" | 29 #include "content/public/browser/notification_service.h" |
30 #include "content/public/browser/render_process_host.h" | 30 #include "content/public/browser/render_process_host.h" |
31 #include "content/public/browser/render_view_host.h" | 31 #include "content/public/browser/render_view_host.h" |
32 #include "content/public/browser/render_view_host_delegate.h" | |
33 #include "content/public/browser/site_instance.h" | 32 #include "content/public/browser/site_instance.h" |
34 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
| 34 #include "content/public/browser/web_contents_delegate.h" |
35 #include "content/public/common/renderer_preferences.h" | 35 #include "content/public/common/renderer_preferences.h" |
36 | 36 |
37 #if defined(OS_MACOSX) | 37 #if defined(OS_MACOSX) |
38 #include "chrome/browser/extensions/extension_host_mac.h" | 38 #include "chrome/browser/extensions/extension_host_mac.h" |
39 #endif | 39 #endif |
40 | 40 |
41 using content::BrowserThread; | 41 using content::BrowserThread; |
42 using content::OpenURLParams; | 42 using content::OpenURLParams; |
43 using content::Referrer; | 43 using content::Referrer; |
44 using content::RenderViewHost; | 44 using content::RenderViewHost; |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // able to save settings from OTR. | 287 // able to save settings from OTR. |
288 if (!browser || browser->profile()->IsOffTheRecord()) { | 288 if (!browser || browser->profile()->IsOffTheRecord()) { |
289 Profile* profile = GetProfile(); | 289 Profile* profile = GetProfile(); |
290 browser = browser::FindOrCreateTabbedBrowser(profile->GetOriginalProfile()); | 290 browser = browser::FindOrCreateTabbedBrowser(profile->GetOriginalProfile()); |
291 } | 291 } |
292 | 292 |
293 OpenURLParams params(extension->options_url(), Referrer(), SINGLETON_TAB, | 293 OpenURLParams params(extension->options_url(), Referrer(), SINGLETON_TAB, |
294 content::PAGE_TRANSITION_LINK, false); | 294 content::PAGE_TRANSITION_LINK, false); |
295 browser->OpenURL(params); | 295 browser->OpenURL(params); |
296 browser->window()->Show(); | 296 browser->window()->Show(); |
297 browser->GetSelectedWebContents()->GetRenderViewHost()->GetDelegate()-> | 297 WebContents* web_contents = browser->GetSelectedWebContents(); |
298 Activate(); | 298 web_contents->GetDelegate()->ActivateContents(web_contents); |
299 } | 299 } |
300 | 300 |
301 ExtensionHost* ExtensionProcessManager::GetBackgroundHostForExtension( | 301 ExtensionHost* ExtensionProcessManager::GetBackgroundHostForExtension( |
302 const std::string& extension_id) { | 302 const std::string& extension_id) { |
303 for (ExtensionHostSet::iterator iter = background_hosts_.begin(); | 303 for (ExtensionHostSet::iterator iter = background_hosts_.begin(); |
304 iter != background_hosts_.end(); ++iter) { | 304 iter != background_hosts_.end(); ++iter) { |
305 ExtensionHost* host = *iter; | 305 ExtensionHost* host = *iter; |
306 if (host->extension_id() == extension_id) | 306 if (host->extension_id() == extension_id) |
307 return host; | 307 return host; |
308 } | 308 } |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 if (service && service->is_ready()) | 775 if (service && service->is_ready()) |
776 CreateBackgroundHostsForProfileStartup(this, service->extensions()); | 776 CreateBackgroundHostsForProfileStartup(this, service->extensions()); |
777 } | 777 } |
778 break; | 778 break; |
779 } | 779 } |
780 default: | 780 default: |
781 ExtensionProcessManager::Observe(type, source, details); | 781 ExtensionProcessManager::Observe(type, source, details); |
782 break; | 782 break; |
783 } | 783 } |
784 } | 784 } |
OLD | NEW |