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

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

Issue 1363093004: Add BrowserSelectFileDialogTest.OpenCloseFileDialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enable the test and skip libglib-2.0 from LSan report Created 5 years, 2 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 std::string new_selected_encoding_list; 878 std::string new_selected_encoding_list;
879 if (CharacterEncoding::UpdateRecentlySelectedEncoding( 879 if (CharacterEncoding::UpdateRecentlySelectedEncoding(
880 profile_->GetPrefs()->GetString(prefs::kRecentlySelectedEncoding), 880 profile_->GetPrefs()->GetString(prefs::kRecentlySelectedEncoding),
881 encoding_id, 881 encoding_id,
882 &new_selected_encoding_list)) { 882 &new_selected_encoding_list)) {
883 profile_->GetPrefs()->SetString(prefs::kRecentlySelectedEncoding, 883 profile_->GetPrefs()->SetString(prefs::kRecentlySelectedEncoding,
884 new_selected_encoding_list); 884 new_selected_encoding_list);
885 } 885 }
886 } 886 }
887 887
888 void Browser::OpenFile() { 888 ui::SelectFileDialog* Browser::OpenFile() {
889 content::RecordAction(UserMetricsAction("OpenFile")); 889 content::RecordAction(UserMetricsAction("OpenFile"));
890 select_file_dialog_ = ui::SelectFileDialog::Create( 890 select_file_dialog_ = ui::SelectFileDialog::Create(
891 this, new ChromeSelectFilePolicy( 891 this, new ChromeSelectFilePolicy(
892 tab_strip_model_->GetActiveWebContents())); 892 tab_strip_model_->GetActiveWebContents()));
893 893
894 const base::FilePath directory = profile_->last_selected_directory(); 894 const base::FilePath directory = profile_->last_selected_directory();
895 895
896 // TODO(beng): figure out how to juggle this. 896 // TODO(beng): figure out how to juggle this.
897 gfx::NativeWindow parent_window = window_->GetNativeWindow(); 897 gfx::NativeWindow parent_window = window_->GetNativeWindow();
898 ui::SelectFileDialog::FileTypeInfo file_types; 898 ui::SelectFileDialog::FileTypeInfo file_types;
899 file_types.support_drive = true; 899 file_types.support_drive = true;
900 select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_OPEN_FILE, 900 select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_OPEN_FILE,
901 base::string16(), 901 base::string16(),
902 directory, 902 directory,
903 &file_types, 903 &file_types,
904 0, 904 0,
905 base::FilePath::StringType(), 905 base::FilePath::StringType(),
906 parent_window, 906 parent_window,
907 NULL); 907 NULL);
908 return select_file_dialog_.get();
908 } 909 }
909 910
910 void Browser::UpdateDownloadShelfVisibility(bool visible) { 911 void Browser::UpdateDownloadShelfVisibility(bool visible) {
911 if (GetStatusBubble()) 912 if (GetStatusBubble())
912 GetStatusBubble()->UpdateDownloadShelfVisibility(visible); 913 GetStatusBubble()->UpdateDownloadShelfVisibility(visible);
913 } 914 }
914 915
915 /////////////////////////////////////////////////////////////////////////////// 916 ///////////////////////////////////////////////////////////////////////////////
916 917
917 void Browser::UpdateUIForNavigationInTab(WebContents* contents, 918 void Browser::UpdateUIForNavigationInTab(WebContents* contents,
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after
2702 if (contents && !allow_js_access) { 2703 if (contents && !allow_js_access) {
2703 contents->web_contents()->GetController().LoadURL( 2704 contents->web_contents()->GetController().LoadURL(
2704 target_url, 2705 target_url,
2705 content::Referrer(), 2706 content::Referrer(),
2706 ui::PAGE_TRANSITION_LINK, 2707 ui::PAGE_TRANSITION_LINK,
2707 std::string()); // No extra headers. 2708 std::string()); // No extra headers.
2708 } 2709 }
2709 2710
2710 return contents != NULL; 2711 return contents != NULL;
2711 } 2712 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698