Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Side by Side Diff: chrome/browser/extensions/extension_install_ui.cc

Issue 7776001: ntp4: improved app install, try 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove #app-id altogether Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 224 }
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(
235 "%s#app-id=%s", chrome::kChromeUINewTabURL, app_id.c_str());
236 browser::NavigateParams params = 234 browser::NavigateParams params =
237 browser->GetSingletonTabNavigateParams(GURL(url)); 235 browser->GetSingletonTabNavigateParams(GURL(chrome::kChromeUINewTabURL));
238 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE;
239 browser::Navigate(&params); 236 browser::Navigate(&params);
237
238 NotificationService::current()->Notify(
239 chrome::NOTIFICATION_APP_INSTALLED_TO_NTP,
240 Source<TabContents>(params.target_contents->tab_contents()),
241 Details<const std::string>(&app_id));
240 } 242 }
241 243
242 // static 244 // static
243 void ExtensionInstallUI::DisableFailureUIForTests() { 245 void ExtensionInstallUI::DisableFailureUIForTests() {
244 disable_failure_ui_for_tests = true; 246 disable_failure_ui_for_tests = true;
245 } 247 }
246 248
247 void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id, 249 void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id,
248 bool previous_using_native_theme, 250 bool previous_using_native_theme,
249 const Extension* new_theme, 251 const Extension* new_theme,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 303
302 InfoBarDelegate* ExtensionInstallUI::GetNewThemeInstalledInfoBarDelegate( 304 InfoBarDelegate* ExtensionInstallUI::GetNewThemeInstalledInfoBarDelegate(
303 TabContents* tab_contents, 305 TabContents* tab_contents,
304 const Extension* new_theme, 306 const Extension* new_theme,
305 const std::string& previous_theme_id, 307 const std::string& previous_theme_id,
306 bool previous_using_native_theme) { 308 bool previous_using_native_theme) {
307 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, 309 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme,
308 previous_theme_id, 310 previous_theme_id,
309 previous_using_native_theme); 311 previous_using_native_theme);
310 } 312 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698