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/ui/extensions/application_launch.h" | 5 #include "chrome/browser/ui/extensions/application_launch.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/browser/extensions/extension_prefs.h" | 9 #include "chrome/browser/extensions/extension_prefs.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial | 135 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial |
136 // focus explicitly. | 136 // focus explicitly. |
137 web_contents->GetView()->SetInitialFocus(); | 137 web_contents->GetView()->SetInitialFocus(); |
138 return web_contents; | 138 return web_contents; |
139 } | 139 } |
140 | 140 |
141 WebContents* OpenApplicationTab(Profile* profile, | 141 WebContents* OpenApplicationTab(Profile* profile, |
142 const Extension* extension, | 142 const Extension* extension, |
143 const GURL& override_url, | 143 const GURL& override_url, |
144 WindowOpenDisposition disposition) { | 144 WindowOpenDisposition disposition) { |
145 Browser* browser = browser::FindTabbedBrowser(profile, | 145 Browser* browser = chrome::FindTabbedBrowser(profile, |
146 false, | 146 false, |
147 chrome::GetActiveDesktop()); | 147 chrome::GetActiveDesktop()); |
148 WebContents* contents = NULL; | 148 WebContents* contents = NULL; |
149 if (!browser) { | 149 if (!browser) { |
150 // No browser for this profile, need to open a new one. | 150 // No browser for this profile, need to open a new one. |
151 browser = new Browser(Browser::CreateParams(Browser::TYPE_TABBED, | 151 browser = new Browser(Browser::CreateParams(Browser::TYPE_TABBED, |
152 profile, | 152 profile, |
153 chrome::GetActiveDesktop())); | 153 chrome::GetActiveDesktop())); |
154 browser->window()->Show(); | 154 browser->window()->Show(); |
155 // There's no current tab in this browser window, so add a new one. | 155 // There's no current tab in this browser window, so add a new one. |
156 disposition = NEW_FOREGROUND_TAB; | 156 disposition = NEW_FOREGROUND_TAB; |
157 } else { | 157 } else { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // OnDidGetApplicationInfo, which calls | 300 // OnDidGetApplicationInfo, which calls |
301 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as | 301 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as |
302 // pending web app action. | 302 // pending web app action. |
303 extensions::TabHelper::FromWebContents(tab)->set_pending_web_app_action( | 303 extensions::TabHelper::FromWebContents(tab)->set_pending_web_app_action( |
304 extensions::TabHelper::UPDATE_SHORTCUT); | 304 extensions::TabHelper::UPDATE_SHORTCUT); |
305 | 305 |
306 return tab; | 306 return tab; |
307 } | 307 } |
308 | 308 |
309 } // namespace application_launch | 309 } // namespace application_launch |
OLD | NEW |