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

Side by Side Diff: chrome/browser/file_select_helper.cc

Issue 2113353002: Fix file chooser on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« 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/file_select_helper.h" 5 #include "chrome/browser/file_select_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 void FileSelectHelper::Observe(int type, 648 void FileSelectHelper::Observe(int type,
649 const content::NotificationSource& source, 649 const content::NotificationSource& source,
650 const content::NotificationDetails& details) { 650 const content::NotificationDetails& details) {
651 DCHECK_EQ(content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, type); 651 DCHECK_EQ(content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, type);
652 render_frame_host_ = nullptr; 652 render_frame_host_ = nullptr;
653 } 653 }
654 654
655 void FileSelectHelper::RenderFrameHostChanged( 655 void FileSelectHelper::RenderFrameHostChanged(
656 content::RenderFrameHost* old_host, 656 content::RenderFrameHost* old_host,
657 content::RenderFrameHost* new_host) { 657 content::RenderFrameHost* new_host) {
658 render_frame_host_ = nullptr; 658 if (old_host == render_frame_host_)
659 render_frame_host_ = nullptr;
Charlie Reis 2016/07/01 21:50:18 Seems right. We should probably add a CleanUp cal
659 } 660 }
660 661
661 void FileSelectHelper::RenderFrameDeleted( 662 void FileSelectHelper::RenderFrameDeleted(
662 content::RenderFrameHost* render_frame_host) { 663 content::RenderFrameHost* render_frame_host) {
663 render_frame_host_ = nullptr; 664 if (render_frame_host == render_frame_host_)
665 render_frame_host_ = nullptr;
664 } 666 }
665 667
666 void FileSelectHelper::WebContentsDestroyed() { 668 void FileSelectHelper::WebContentsDestroyed() {
667 render_frame_host_ = nullptr; 669 render_frame_host_ = nullptr;
668 web_contents_ = nullptr; 670 web_contents_ = nullptr;
669 CleanUp(); 671 CleanUp();
670 } 672 }
671 673
672 // static 674 // static
673 bool FileSelectHelper::IsAcceptTypeValid(const std::string& accept_type) { 675 bool FileSelectHelper::IsAcceptTypeValid(const std::string& accept_type) {
(...skipping 12 matching lines...) Expand all
686 688
687 // static 689 // static
688 base::FilePath FileSelectHelper::GetSanitizedFileName( 690 base::FilePath FileSelectHelper::GetSanitizedFileName(
689 const base::FilePath& suggested_filename) { 691 const base::FilePath& suggested_filename) {
690 if (suggested_filename.empty()) 692 if (suggested_filename.empty())
691 return base::FilePath(); 693 return base::FilePath();
692 return net::GenerateFileName( 694 return net::GenerateFileName(
693 GURL(), std::string(), std::string(), suggested_filename.AsUTF8Unsafe(), 695 GURL(), std::string(), std::string(), suggested_filename.AsUTF8Unsafe(),
694 std::string(), l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME)); 696 std::string(), l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
695 } 697 }
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