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/extension_install_ui_default.h" | 5 #include "chrome/browser/ui/extensions/extension_install_ui_default.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" | 10 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 void ExtensionInstallUIDefault::OpenAppInstalledUI(const std::string& app_id) { | 223 void ExtensionInstallUIDefault::OpenAppInstalledUI(const std::string& app_id) { |
224 #if defined(OS_CHROMEOS) | 224 #if defined(OS_CHROMEOS) |
225 // App Launcher always enabled on ChromeOS, so always handled in | 225 // App Launcher always enabled on ChromeOS, so always handled in |
226 // OnInstallSuccess. | 226 // OnInstallSuccess. |
227 NOTREACHED(); | 227 NOTREACHED(); |
228 #else | 228 #else |
229 Profile* current_profile = profile_->GetOriginalProfile(); | 229 Profile* current_profile = profile_->GetOriginalProfile(); |
230 Browser* browser = FindOrCreateVisibleBrowser(current_profile); | 230 Browser* browser = FindOrCreateVisibleBrowser(current_profile); |
231 if (browser) { | 231 if (browser) { |
232 GURL url(chrome::IsInstantExtendedAPIEnabled() | 232 GURL url(search::IsInstantExtendedAPIEnabled() |
233 ? chrome::kChromeUIAppsURL | 233 ? chrome::kChromeUIAppsURL |
234 : chrome::kChromeUINewTabURL); | 234 : chrome::kChromeUINewTabURL); |
235 chrome::NavigateParams params( | 235 chrome::NavigateParams params( |
236 chrome::GetSingletonTabNavigateParams(browser, url)); | 236 chrome::GetSingletonTabNavigateParams(browser, url)); |
237 chrome::Navigate(¶ms); | 237 chrome::Navigate(¶ms); |
238 | 238 |
239 content::NotificationService::current()->Notify( | 239 content::NotificationService::current()->Notify( |
240 chrome::NOTIFICATION_APP_INSTALLED_TO_NTP, | 240 chrome::NOTIFICATION_APP_INSTALLED_TO_NTP, |
241 content::Source<WebContents>(params.target_contents), | 241 content::Source<WebContents>(params.target_contents), |
242 content::Details<const std::string>(&app_id)); | 242 content::Details<const std::string>(&app_id)); |
(...skipping 12 matching lines...) Expand all Loading... |
255 gfx::NativeWindow ExtensionInstallUIDefault::GetDefaultInstallDialogParent() { | 255 gfx::NativeWindow ExtensionInstallUIDefault::GetDefaultInstallDialogParent() { |
256 Browser* browser = | 256 Browser* browser = |
257 chrome::FindLastActiveWithProfile(profile_, chrome::GetActiveDesktop()); | 257 chrome::FindLastActiveWithProfile(profile_, chrome::GetActiveDesktop()); |
258 if (browser) { | 258 if (browser) { |
259 content::WebContents* contents = | 259 content::WebContents* contents = |
260 browser->tab_strip_model()->GetActiveWebContents(); | 260 browser->tab_strip_model()->GetActiveWebContents(); |
261 return contents->GetTopLevelNativeWindow(); | 261 return contents->GetTopLevelNativeWindow(); |
262 } | 262 } |
263 return NULL; | 263 return NULL; |
264 } | 264 } |
OLD | NEW |