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

Side by Side Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 23935004: Preserve the app in the AppLauncherHandler if it's disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tiny change for consistency Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/webui/ntp/app_launcher_handler.h" 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "apps/app_launcher.h" 9 #include "apps/app_launcher.h"
10 #include "apps/metrics_names.h" 10 #include "apps/metrics_names.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 288 }
289 if (!extension->is_app()) 289 if (!extension->is_app())
290 return; 290 return;
291 291
292 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); 292 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
293 if (!ShouldDisplayInNewTabPage(extension, prefs)) 293 if (!ShouldDisplayInNewTabPage(extension, prefs))
294 return; 294 return;
295 295
296 scoped_ptr<DictionaryValue> app_info(GetAppInfo(extension)); 296 scoped_ptr<DictionaryValue> app_info(GetAppInfo(extension));
297 if (app_info.get()) { 297 if (app_info.get()) {
298 visible_apps_.erase(extension->id()); 298 if (uninstalled)
299 visible_apps_.erase(extension->id());
299 300
300 scoped_ptr<base::FundamentalValue> uninstall_value( 301 scoped_ptr<base::FundamentalValue> uninstall_value(
301 Value::CreateBooleanValue(uninstalled)); 302 Value::CreateBooleanValue(uninstalled));
302 scoped_ptr<base::FundamentalValue> from_page( 303 scoped_ptr<base::FundamentalValue> from_page(
303 Value::CreateBooleanValue(!extension_id_prompting_.empty())); 304 Value::CreateBooleanValue(!extension_id_prompting_.empty()));
304 web_ui()->CallJavascriptFunction( 305 web_ui()->CallJavascriptFunction(
305 "ntp.appRemoved", *app_info, *uninstall_value, *from_page); 306 "ntp.appRemoved", *app_info, *uninstall_value, *from_page);
306 } 307 }
307 break; 308 break;
308 } 309 }
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { 828 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() {
828 if (!extension_uninstall_dialog_.get()) { 829 if (!extension_uninstall_dialog_.get()) {
829 Browser* browser = chrome::FindBrowserWithWebContents( 830 Browser* browser = chrome::FindBrowserWithWebContents(
830 web_ui()->GetWebContents()); 831 web_ui()->GetWebContents());
831 extension_uninstall_dialog_.reset( 832 extension_uninstall_dialog_.reset(
832 ExtensionUninstallDialog::Create(extension_service_->profile(), 833 ExtensionUninstallDialog::Create(extension_service_->profile(),
833 browser, this)); 834 browser, this));
834 } 835 }
835 return extension_uninstall_dialog_.get(); 836 return extension_uninstall_dialog_.get();
836 } 837 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698