Chromium Code Reviews| 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/webui/ntp/app_launcher_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 699 return; | 699 return; |
| 700 } | 700 } |
| 701 | 701 |
| 702 scoped_ptr<AppInstallInfo> install_info(new AppInstallInfo()); | 702 scoped_ptr<AppInstallInfo> install_info(new AppInstallInfo()); |
| 703 install_info->is_bookmark_app = true; | 703 install_info->is_bookmark_app = true; |
| 704 install_info->title = title; | 704 install_info->title = title; |
| 705 install_info->app_url = launch_url; | 705 install_info->app_url = launch_url; |
| 706 install_info->page_ordinal = page_ordinal; | 706 install_info->page_ordinal = page_ordinal; |
| 707 | 707 |
| 708 FaviconService::Handle h = favicon_service->GetFaviconImageForURL( | 708 FaviconService::Handle h = favicon_service->GetFaviconImageForURL( |
| 709 profile, launch_url, history::FAVICON, gfx::kFaviconSize, | 709 FaviconService::FaviconForURLParams(profile, launch_url, history::FAVICON, |
|
James Hawkins
2012/09/05 22:39:50
nit: The start of param rows must align on the sam
| |
| 710 &favicon_consumer_, | 710 gfx::kFaviconSize, &favicon_consumer_), |
| 711 base::Bind(&AppLauncherHandler::OnFaviconForApp, base::Unretained(this))); | 711 base::Bind(&AppLauncherHandler::OnFaviconForApp, base::Unretained(this))); |
| 712 favicon_consumer_.SetClientData(favicon_service, h, install_info.release()); | 712 favicon_consumer_.SetClientData(favicon_service, h, install_info.release()); |
| 713 } | 713 } |
| 714 | 714 |
| 715 void AppLauncherHandler::HandleRecordAppLaunchByUrl( | 715 void AppLauncherHandler::HandleRecordAppLaunchByUrl( |
| 716 const base::ListValue* args) { | 716 const base::ListValue* args) { |
| 717 std::string url; | 717 std::string url; |
| 718 CHECK(args->GetString(0, &url)); | 718 CHECK(args->GetString(0, &url)); |
| 719 double source; | 719 double source; |
| 720 CHECK(args->GetDouble(1, &source)); | 720 CHECK(args->GetDouble(1, &source)); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 940 | 940 |
| 941 ExtensionInstallPrompt* AppLauncherHandler::GetExtensionInstallPrompt() { | 941 ExtensionInstallPrompt* AppLauncherHandler::GetExtensionInstallPrompt() { |
| 942 if (!extension_install_ui_.get()) { | 942 if (!extension_install_ui_.get()) { |
| 943 Browser* browser = browser::FindBrowserWithWebContents( | 943 Browser* browser = browser::FindBrowserWithWebContents( |
| 944 web_ui()->GetWebContents()); | 944 web_ui()->GetWebContents()); |
| 945 extension_install_ui_.reset( | 945 extension_install_ui_.reset( |
| 946 chrome::CreateExtensionInstallPromptWithBrowser(browser)); | 946 chrome::CreateExtensionInstallPromptWithBrowser(browser)); |
| 947 } | 947 } |
| 948 return extension_install_ui_.get(); | 948 return extension_install_ui_.get(); |
| 949 } | 949 } |
| OLD | NEW |