| 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 "chrome/browser/extensions/extension_tab_util.h" | 5 #include "chrome/browser/extensions/extension_tab_util.h" |
| 6 | 6 |
| 7 #include "apps/shell_window.h" |
| 7 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 8 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| 8 #include "chrome/browser/extensions/shell_window_registry.h" | 9 #include "chrome/browser/extensions/shell_window_registry.h" |
| 9 #include "chrome/browser/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
| 10 #include "chrome/browser/extensions/window_controller.h" | 11 #include "chrome/browser/extensions/window_controller.h" |
| 11 #include "chrome/browser/extensions/window_controller_list.h" | 12 #include "chrome/browser/extensions/window_controller_list.h" |
| 12 #include "chrome/browser/net/url_fixer_upper.h" | 13 #include "chrome/browser/net/url_fixer_upper.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/sessions/session_id.h" | 15 #include "chrome/browser/sessions/session_id.h" |
| 15 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/browser/ui/browser_finder.h" | 17 #include "chrome/browser/ui/browser_finder.h" |
| 17 #include "chrome/browser/ui/browser_iterator.h" | 18 #include "chrome/browser/ui/browser_iterator.h" |
| 18 #include "chrome/browser/ui/browser_window.h" | 19 #include "chrome/browser/ui/browser_window.h" |
| 19 #include "chrome/browser/ui/extensions/shell_window.h" | |
| 20 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" | 20 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
| 21 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 21 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 22 #include "chrome/common/extensions/extension.h" | 22 #include "chrome/common/extensions/extension.h" |
| 23 #include "chrome/common/extensions/extension_manifest_constants.h" | 23 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 24 #include "chrome/common/extensions/manifest_url_handler.h" | 24 #include "chrome/common/extensions/manifest_url_handler.h" |
| 25 #include "chrome/common/extensions/permissions/api_permission.h" | 25 #include "chrome/common/extensions/permissions/api_permission.h" |
| 26 #include "chrome/common/extensions/permissions/permissions_data.h" | 26 #include "chrome/common/extensions/permissions/permissions_data.h" |
| 27 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 28 #include "content/public/browser/favicon_status.h" | 28 #include "content/public/browser/favicon_status.h" |
| 29 #include "content/public/browser/navigation_entry.h" | 29 #include "content/public/browser/navigation_entry.h" |
| 30 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
| 31 #include "googleurl/src/gurl.h" | 31 #include "googleurl/src/gurl.h" |
| 32 | 32 |
| 33 namespace keys = extensions::tabs_constants; | 33 namespace keys = extensions::tabs_constants; |
| 34 namespace tabs = extensions::api::tabs; | 34 namespace tabs = extensions::api::tabs; |
| 35 | 35 |
| 36 using apps::ShellWindow; |
| 36 using content::NavigationEntry; | 37 using content::NavigationEntry; |
| 37 using content::WebContents; | 38 using content::WebContents; |
| 38 using extensions::APIPermission; | 39 using extensions::APIPermission; |
| 39 using extensions::Extension; | 40 using extensions::Extension; |
| 40 | 41 |
| 41 namespace { | 42 namespace { |
| 42 | 43 |
| 43 extensions::WindowController* GetShellWindowController( | 44 extensions::WindowController* GetShellWindowController( |
| 44 const WebContents* contents) { | 45 const WebContents* contents) { |
| 45 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); | 46 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 content::OpenURLParams params( | 343 content::OpenURLParams params( |
| 343 extensions::ManifestURL::GetOptionsPage(extension), | 344 extensions::ManifestURL::GetOptionsPage(extension), |
| 344 content::Referrer(), SINGLETON_TAB, | 345 content::Referrer(), SINGLETON_TAB, |
| 345 content::PAGE_TRANSITION_LINK, false); | 346 content::PAGE_TRANSITION_LINK, false); |
| 346 browser->OpenURL(params); | 347 browser->OpenURL(params); |
| 347 browser->window()->Show(); | 348 browser->window()->Show(); |
| 348 WebContents* web_contents = | 349 WebContents* web_contents = |
| 349 browser->tab_strip_model()->GetActiveWebContents(); | 350 browser->tab_strip_model()->GetActiveWebContents(); |
| 350 web_contents->GetDelegate()->ActivateContents(web_contents); | 351 web_contents->GetDelegate()->ActivateContents(web_contents); |
| 351 } | 352 } |
| OLD | NEW |