Chromium Code Reviews| 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_install_ui.h" | 5 #include "chrome/browser/extensions/extension_install_ui.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 default: | 225 default: |
| 226 NOTREACHED() << "Unknown message"; | 226 NOTREACHED() << "Unknown message"; |
| 227 break; | 227 break; |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 | 230 |
| 231 // static | 231 // static |
| 232 void ExtensionInstallUI::OpenAppInstalledNTP(Browser* browser, | 232 void ExtensionInstallUI::OpenAppInstalledNTP(Browser* browser, |
| 233 const std::string& app_id) { | 233 const std::string& app_id) { |
| 234 std::string url = base::StringPrintf( | 234 std::string url = base::StringPrintf( |
| 235 "%s#app-id=%s", chrome::kChromeUINewTabURL, app_id.c_str()); | 235 "%s#app-id=%s", chrome::kChromeUINewTabURL, app_id.c_str()); |
|
Rick Byers
2011/08/29 16:01:00
Why do you still need the code for setting and rea
Evan Stade
2011/08/29 18:15:16
hmm. I tried to do what you're suggesting and it d
| |
| 236 browser::NavigateParams params = | 236 browser::NavigateParams params = |
| 237 browser->GetSingletonTabNavigateParams(GURL(url)); | 237 browser->GetSingletonTabNavigateParams(GURL(url)); |
| 238 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; | |
| 239 browser::Navigate(¶ms); | 238 browser::Navigate(¶ms); |
| 239 | |
| 240 NotificationService::current()->Notify( | |
| 241 chrome::NOTIFICATION_APP_INSTALLED_TO_NTP, | |
| 242 Source<TabContents>(params.target_contents->tab_contents()), | |
| 243 Details<const std::string>(&app_id)); | |
| 240 } | 244 } |
| 241 | 245 |
| 242 // static | 246 // static |
| 243 void ExtensionInstallUI::DisableFailureUIForTests() { | 247 void ExtensionInstallUI::DisableFailureUIForTests() { |
| 244 disable_failure_ui_for_tests = true; | 248 disable_failure_ui_for_tests = true; |
| 245 } | 249 } |
| 246 | 250 |
| 247 void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id, | 251 void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id, |
| 248 bool previous_using_native_theme, | 252 bool previous_using_native_theme, |
| 249 const Extension* new_theme, | 253 const Extension* new_theme, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 301 | 305 |
| 302 InfoBarDelegate* ExtensionInstallUI::GetNewThemeInstalledInfoBarDelegate( | 306 InfoBarDelegate* ExtensionInstallUI::GetNewThemeInstalledInfoBarDelegate( |
| 303 TabContents* tab_contents, | 307 TabContents* tab_contents, |
| 304 const Extension* new_theme, | 308 const Extension* new_theme, |
| 305 const std::string& previous_theme_id, | 309 const std::string& previous_theme_id, |
| 306 bool previous_using_native_theme) { | 310 bool previous_using_native_theme) { |
| 307 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, | 311 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, |
| 308 previous_theme_id, | 312 previous_theme_id, |
| 309 previous_using_native_theme); | 313 previous_using_native_theme); |
| 310 } | 314 } |
| OLD | NEW |