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

Side by Side Diff: chrome/browser/chromeos/file_manager/file_browser_handlers.cc

Issue 238633009: cleanup: Use EventRouter instead of ExtensionSystem::Get->event_router() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 (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/chromeos/file_manager/file_browser_handlers.h" 5 #include "chrome/browser/chromeos/file_manager/file_browser_handlers.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 int handler_pid_in, 352 int handler_pid_in,
353 extensions::ExtensionHost* host) { 353 extensions::ExtensionHost* host) {
354 int handler_pid = host ? host->render_process_host()->GetID() : 354 int handler_pid = host ? host->render_process_host()->GetID() :
355 handler_pid_in; 355 handler_pid_in;
356 356
357 if (handler_pid <= 0) { 357 if (handler_pid <= 0) {
358 ExecuteDoneOnUIThread(false); 358 ExecuteDoneOnUIThread(false);
359 return; 359 return;
360 } 360 }
361 361
362 extensions::EventRouter* event_router = 362 extensions::EventRouter* router = extensions::EventRouter::Get(profile_);
363 extensions::ExtensionSystem::Get(profile_)->event_router(); 363 if (!router) {
364 if (!event_router) {
365 ExecuteDoneOnUIThread(false); 364 ExecuteDoneOnUIThread(false);
366 return; 365 return;
367 } 366 }
368 367
369 SetupHandlerHostFileAccessPermissions( 368 SetupHandlerHostFileAccessPermissions(
370 file_definition_list.get(), extension_.get(), handler_pid); 369 file_definition_list.get(), extension_.get(), handler_pid);
371 370
372 scoped_ptr<base::ListValue> event_args(new base::ListValue()); 371 scoped_ptr<base::ListValue> event_args(new base::ListValue());
373 event_args->Append(new base::StringValue(action_id_)); 372 event_args->Append(new base::StringValue(action_id_));
374 base::DictionaryValue* details = new base::DictionaryValue(); 373 base::DictionaryValue* details = new base::DictionaryValue();
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 if (common_handlers.empty()) 524 if (common_handlers.empty())
526 return FileBrowserHandlerList(); 525 return FileBrowserHandlerList();
527 } 526 }
528 } 527 }
529 528
530 return common_handlers; 529 return common_handlers;
531 } 530 }
532 531
533 } // namespace file_browser_handlers 532 } // namespace file_browser_handlers
534 } // namespace file_manager 533 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698