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 "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 938 const GURL& current_page_url = GetURL(); | 938 const GURL& current_page_url = GetURL(); |
| 939 if (dlm && current_page_url.is_valid()) { | 939 if (dlm && current_page_url.is_valid()) { |
| 940 DownloadSaveInfo save_info; | 940 DownloadSaveInfo save_info; |
| 941 save_info.prompt_for_save_location = true; | 941 save_info.prompt_for_save_location = true; |
| 942 dlm->DownloadUrl(current_page_url, | 942 dlm->DownloadUrl(current_page_url, |
| 943 GURL(), | 943 GURL(), |
| 944 "", | 944 "", |
| 945 true, // prefer_cache | 945 true, // prefer_cache |
| 946 save_info, | 946 save_info, |
| 947 this); | 947 this); |
| 948 download_stats::RecordDownloadCount( | 948 download_stats::RecordDownloadSource( |
| 949 download_stats::INITIATED_BY_SAVE_PACKAGE_FAILURE_COUNT); | 949 download_stats::INITIATED_BY_SAVE_PACKAGE_FAILURE); |
| 950 return; | 950 return; |
| 951 } | 951 } |
| 952 } | 952 } |
| 953 | 953 |
| 954 Stop(); | 954 Stop(); |
| 955 | 955 |
| 956 // Create the save package and possibly prompt the user for the name to save | 956 // Create the save package and possibly prompt the user for the name to save |
| 957 // the page as. The user prompt is an asynchronous operation that runs on | 957 // the page as. The user prompt is an asynchronous operation that runs on |
| 958 // another thread. | 958 // another thread. |
| 959 save_package_ = new SavePackage(this); | 959 save_package_ = new SavePackage(this); |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1418 | 1418 |
| 1419 void TabContents::OnUpdateZoomLimits(int minimum_percent, | 1419 void TabContents::OnUpdateZoomLimits(int minimum_percent, |
| 1420 int maximum_percent, | 1420 int maximum_percent, |
| 1421 bool remember) { | 1421 bool remember) { |
| 1422 minimum_zoom_percent_ = minimum_percent; | 1422 minimum_zoom_percent_ = minimum_percent; |
| 1423 maximum_zoom_percent_ = maximum_percent; | 1423 maximum_zoom_percent_ = maximum_percent; |
| 1424 temporary_zoom_settings_ = !remember; | 1424 temporary_zoom_settings_ = !remember; |
| 1425 } | 1425 } |
| 1426 | 1426 |
| 1427 void TabContents::OnSaveURL(const GURL& url) { | 1427 void TabContents::OnSaveURL(const GURL& url) { |
| 1428 download_stats::RecordDownloadSource( | |
| 1429 download_stats::INITIATED_BY_RENDERER_SAVE); | |
|
cbentzel
2012/02/06 19:57:29
Perhaps INITIATED_BY_PEPPER_SAVE? I guess we don't
Randy Smith (Not in Mondays)
2012/02/07 18:20:18
Yeah; from the browser process perspective the dis
cbentzel
2012/02/07 18:29:32
Right now it's only from Pepper. If you merge/reba
Randy Smith (Not in Mondays)
2012/02/07 19:28:14
Done.
| |
| 1428 DownloadManager* dlm = GetBrowserContext()->GetDownloadManager(); | 1430 DownloadManager* dlm = GetBrowserContext()->GetDownloadManager(); |
| 1429 DownloadSaveInfo save_info; | 1431 DownloadSaveInfo save_info; |
| 1430 save_info.prompt_for_save_location = true; | 1432 save_info.prompt_for_save_location = true; |
| 1431 dlm->DownloadUrl(url, GetURL(), "", true, save_info, this); | 1433 dlm->DownloadUrl(url, GetURL(), "", true, save_info, this); |
| 1432 } | 1434 } |
| 1433 | 1435 |
| 1434 void TabContents::OnEnumerateDirectory(int request_id, | 1436 void TabContents::OnEnumerateDirectory(int request_id, |
| 1435 const FilePath& path) { | 1437 const FilePath& path) { |
| 1436 delegate_->EnumerateDirectory(this, request_id, path); | 1438 delegate_->EnumerateDirectory(this, request_id, path); |
| 1437 } | 1439 } |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2287 encoding_ = content::GetContentClient()->browser()-> | 2289 encoding_ = content::GetContentClient()->browser()-> |
| 2288 GetCanonicalEncodingNameByAliasName(encoding); | 2290 GetCanonicalEncodingNameByAliasName(encoding); |
| 2289 } | 2291 } |
| 2290 | 2292 |
| 2291 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2293 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2292 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2294 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2293 // Can be NULL during tests. | 2295 // Can be NULL during tests. |
| 2294 if (rwh_view) | 2296 if (rwh_view) |
| 2295 rwh_view->SetSize(GetView()->GetContainerSize()); | 2297 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2296 } | 2298 } |
| OLD | NEW |