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

Side by Side Diff: chrome/browser/extensions/extension_function_dispatcher.cc

Issue 7492051: Revert 94332 - Removal of Profile from content part 2. (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
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/extensions/extension_function_dispatcher.h" 5 #include "chrome/browser/extensions/extension_function_dispatcher.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 491
492 // If the delegate has an associated browser, that is always the right answer. 492 // If the delegate has an associated browser, that is always the right answer.
493 if (browser) 493 if (browser)
494 return browser; 494 return browser;
495 495
496 // Otherwise, try to default to a reasonable browser. If |include_incognito| 496 // Otherwise, try to default to a reasonable browser. If |include_incognito|
497 // is true, we will also search browsers in the incognito version of this 497 // is true, we will also search browsers in the incognito version of this
498 // profile. Note that the profile may already be incognito, in which case 498 // profile. Note that the profile may already be incognito, in which case
499 // we will search the incognito version only, regardless of the value of 499 // we will search the incognito version only, regardless of the value of
500 // |include_incognito|. 500 // |include_incognito|.
501 Profile* profile = Profile::FromBrowserContext( 501 Profile* profile = render_view_host->process()->profile();
502 render_view_host->process()->browser_context());
503 browser = BrowserList::FindTabbedBrowser(profile, include_incognito); 502 browser = BrowserList::FindTabbedBrowser(profile, include_incognito);
504 503
505 // NOTE(rafaelw): This can return NULL in some circumstances. In particular, 504 // NOTE(rafaelw): This can return NULL in some circumstances. In particular,
506 // a background_page onload chrome.tabs api call can make it into here 505 // a background_page onload chrome.tabs api call can make it into here
507 // before the browser is sufficiently initialized to return here. 506 // before the browser is sufficiently initialized to return here.
508 // A similar situation may arise during shutdown. 507 // A similar situation may arise during shutdown.
509 // TODO(rafaelw): Delay creation of background_page until the browser 508 // TODO(rafaelw): Delay creation of background_page until the browser
510 // is available. http://code.google.com/p/chromium/issues/detail?id=13284 509 // is available. http://code.google.com/p/chromium/issues/detail?id=13284
511 return browser; 510 return browser;
512 } 511 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 return function; 612 return function;
614 } 613 }
615 614
616 // static 615 // static
617 void ExtensionFunctionDispatcher::SendAccessDenied( 616 void ExtensionFunctionDispatcher::SendAccessDenied(
618 IPC::Message::Sender* ipc_sender, int routing_id, int request_id) { 617 IPC::Message::Sender* ipc_sender, int routing_id, int request_id) {
619 ipc_sender->Send(new ExtensionMsg_Response( 618 ipc_sender->Send(new ExtensionMsg_Response(
620 routing_id, request_id, false, std::string(), 619 routing_id, request_id, false, std::string(),
621 "Access to extension API denied.")); 620 "Access to extension API denied."));
622 } 621 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_event_router.cc ('k') | chrome/browser/extensions/extension_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698