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

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

Issue 10621: Adds the ability for save dialogs to take a default extension.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/web_contents.h" 5 #include "chrome/browser/web_contents.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 int current_index = controller()->GetLastCommittedEntryIndex(); 1055 int current_index = controller()->GetLastCommittedEntryIndex();
1056 *back_list_count = current_index; 1056 *back_list_count = current_index;
1057 *forward_list_count = controller()->GetEntryCount() - current_index - 1; 1057 *forward_list_count = controller()->GetEntryCount() - current_index - 1;
1058 } 1058 }
1059 } 1059 }
1060 1060
1061 void WebContents::RunFileChooser(const std::wstring& default_file) { 1061 void WebContents::RunFileChooser(const std::wstring& default_file) {
1062 HWND toplevel_hwnd = GetAncestor(GetContainerHWND(), GA_ROOT); 1062 HWND toplevel_hwnd = GetAncestor(GetContainerHWND(), GA_ROOT);
1063 if (!select_file_dialog_.get()) 1063 if (!select_file_dialog_.get())
1064 select_file_dialog_ = SelectFileDialog::Create(this); 1064 select_file_dialog_ = SelectFileDialog::Create(this);
1065 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_OPEN_FILE, L"", 1065 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_OPEN_FILE,
1066 default_file, toplevel_hwnd, NULL); 1066 std::wstring(), default_file, std::wstring(),
1067 std::wstring(), toplevel_hwnd, NULL);
1067 } 1068 }
1068 1069
1069 void WebContents::RunJavaScriptMessage( 1070 void WebContents::RunJavaScriptMessage(
1070 const std::wstring& message, 1071 const std::wstring& message,
1071 const std::wstring& default_prompt, 1072 const std::wstring& default_prompt,
1072 const int flags, 1073 const int flags,
1073 IPC::Message* reply_msg, 1074 IPC::Message* reply_msg,
1074 bool* did_suppress_message) { 1075 bool* did_suppress_message) {
1075 // Suppress javascript messages when requested and when inside a constrained 1076 // Suppress javascript messages when requested and when inside a constrained
1076 // popup window (because that activates them and breaks them out of the 1077 // popup window (because that activates them and breaks them out of the
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
1821 // The favicon url isn't valid. This means there really isn't a favicon, 1822 // The favicon url isn't valid. This means there really isn't a favicon,
1822 // or the favicon url wasn't obtained before the load started. This assumes 1823 // or the favicon url wasn't obtained before the load started. This assumes
1823 // the later. 1824 // the later.
1824 // TODO(sky): Need a way to set the favicon that doesn't involve generating 1825 // TODO(sky): Need a way to set the favicon that doesn't involve generating
1825 // its url. 1826 // its url.
1826 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); 1827 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer));
1827 } 1828 }
1828 new_url->set_safe_for_autoreplace(true); 1829 new_url->set_safe_for_autoreplace(true);
1829 url_model->Add(new_url); 1830 url_model->Add(new_url);
1830 } 1831 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698