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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/file_select_helper.h ('k') | chrome/browser/first_run/first_run_win.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <string> 7 #include <string>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 return file_type.release(); 231 return file_type.release();
232 } 232 }
233 233
234 void FileSelectHelper::RunFileChooser( 234 void FileSelectHelper::RunFileChooser(
235 RenderViewHost* render_view_host, 235 RenderViewHost* render_view_host,
236 TabContents* tab_contents, 236 TabContents* tab_contents,
237 const ViewHostMsg_RunFileChooser_Params& params) { 237 const ViewHostMsg_RunFileChooser_Params& params) {
238 DCHECK(!render_view_host_); 238 DCHECK(!render_view_host_);
239 render_view_host_ = render_view_host; 239 render_view_host_ = render_view_host;
240 notification_registrar_.RemoveAll(); 240 notification_registrar_.RemoveAll();
241 notification_registrar_.Add(this, 241 notification_registrar_.Add(
242 NotificationType::RENDER_WIDGET_HOST_DESTROYED, 242 this, content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
243 Source<RenderViewHost>(render_view_host)); 243 Source<RenderViewHost>(render_view_host));
244 244
245 if (!select_file_dialog_.get()) 245 if (!select_file_dialog_.get())
246 select_file_dialog_ = SelectFileDialog::Create(this); 246 select_file_dialog_ = SelectFileDialog::Create(this);
247 247
248 switch (params.mode) { 248 switch (params.mode) {
249 case ViewHostMsg_RunFileChooser_Mode::Open: 249 case ViewHostMsg_RunFileChooser_Mode::Open:
250 dialog_type_ = SelectFileDialog::SELECT_OPEN_FILE; 250 dialog_type_ = SelectFileDialog::SELECT_OPEN_FILE;
251 break; 251 break;
252 case ViewHostMsg_RunFileChooser_Mode::OpenMultiple: 252 case ViewHostMsg_RunFileChooser_Mode::OpenMultiple:
253 dialog_type_ = SelectFileDialog::SELECT_OPEN_MULTI_FILE; 253 dialog_type_ = SelectFileDialog::SELECT_OPEN_MULTI_FILE;
(...skipping 28 matching lines...) Expand all
282 NULL); 282 NULL);
283 } 283 }
284 284
285 void FileSelectHelper::EnumerateDirectory(int request_id, 285 void FileSelectHelper::EnumerateDirectory(int request_id,
286 RenderViewHost* render_view_host, 286 RenderViewHost* render_view_host,
287 const FilePath& path) { 287 const FilePath& path) {
288 DCHECK_NE(kFileSelectEnumerationId, request_id); 288 DCHECK_NE(kFileSelectEnumerationId, request_id);
289 StartNewEnumeration(path, request_id, render_view_host); 289 StartNewEnumeration(path, request_id, render_view_host);
290 } 290 }
291 291
292 void FileSelectHelper::Observe(NotificationType type, 292 void FileSelectHelper::Observe(int type,
293 const NotificationSource& source, 293 const NotificationSource& source,
294 const NotificationDetails& details) { 294 const NotificationDetails& details) {
295 DCHECK(type == NotificationType::RENDER_WIDGET_HOST_DESTROYED); 295 DCHECK(type == content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED);
296 DCHECK(Details<RenderViewHost>(details).ptr() == render_view_host_); 296 DCHECK(Details<RenderViewHost>(details).ptr() == render_view_host_);
297 render_view_host_ = NULL; 297 render_view_host_ = NULL;
298 } 298 }
299 299
300 FileSelectObserver::FileSelectObserver(TabContents* tab_contents) 300 FileSelectObserver::FileSelectObserver(TabContents* tab_contents)
301 : TabContentsObserver(tab_contents) { 301 : TabContentsObserver(tab_contents) {
302 } 302 }
303 303
304 FileSelectObserver::~FileSelectObserver() { 304 FileSelectObserver::~FileSelectObserver() {
305 } 305 }
(...skipping 27 matching lines...) Expand all
333 path)) { 333 path)) {
334 return; 334 return;
335 } 335 }
336 336
337 if (!file_select_helper_.get()) 337 if (!file_select_helper_.get())
338 file_select_helper_.reset(new FileSelectHelper(tab_contents()->profile())); 338 file_select_helper_.reset(new FileSelectHelper(tab_contents()->profile()));
339 file_select_helper_->EnumerateDirectory(request_id, 339 file_select_helper_->EnumerateDirectory(request_id,
340 tab_contents()->render_view_host(), 340 tab_contents()->render_view_host(),
341 path); 341 path);
342 } 342 }
OLDNEW
« no previous file with comments | « chrome/browser/file_select_helper.h ('k') | chrome/browser/first_run/first_run_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698