| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/api/web_request/chrome_extension_web_request
_event_router_delegate.h" | 5 #include "chrome/browser/extensions/api/web_request/chrome_extension_web_request
_event_router_delegate.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 ~ChromeExtensionWebRequestEventRouterDelegate() { | 46 ~ChromeExtensionWebRequestEventRouterDelegate() { |
| 47 } | 47 } |
| 48 | 48 |
| 49 void ChromeExtensionWebRequestEventRouterDelegate::LogExtensionActivity( | 49 void ChromeExtensionWebRequestEventRouterDelegate::LogExtensionActivity( |
| 50 content::BrowserContext* browser_context, | 50 content::BrowserContext* browser_context, |
| 51 bool is_incognito, | 51 bool is_incognito, |
| 52 const std::string& extension_id, | 52 const std::string& extension_id, |
| 53 const GURL& url, | 53 const GURL& url, |
| 54 const std::string& api_call, | 54 const std::string& api_call, |
| 55 scoped_ptr<base::DictionaryValue> details) { | 55 scoped_ptr<base::DictionaryValue> details) { |
| 56 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 56 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 57 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext( | 57 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext( |
| 58 browser_context)) | 58 browser_context)) |
| 59 return; | 59 return; |
| 60 | 60 |
| 61 scoped_refptr<extensions::Action> action = | 61 scoped_refptr<extensions::Action> action = |
| 62 new extensions::Action(extension_id, | 62 new extensions::Action(extension_id, |
| 63 base::Time::Now(), | 63 base::Time::Now(), |
| 64 extensions::Action::ACTION_WEB_REQUEST, | 64 extensions::Action::ACTION_WEB_REQUEST, |
| 65 api_call); | 65 api_call); |
| 66 action->set_page_url(url); | 66 action->set_page_url(url); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 83 int filter_tab_id, int filter_window_id, net::URLRequest* request) { | 83 int filter_tab_id, int filter_window_id, net::URLRequest* request) { |
| 84 int tab_id = -1; | 84 int tab_id = -1; |
| 85 int window_id = -1; | 85 int window_id = -1; |
| 86 ExtractExtraRequestDetailsInternal(request, &tab_id, &window_id); | 86 ExtractExtraRequestDetailsInternal(request, &tab_id, &window_id); |
| 87 if (filter_tab_id != -1 && tab_id != filter_tab_id) | 87 if (filter_tab_id != -1 && tab_id != filter_tab_id) |
| 88 return true; | 88 return true; |
| 89 if (filter_window_id != -1 && window_id != filter_window_id) | 89 if (filter_window_id != -1 && window_id != filter_window_id) |
| 90 return true; | 90 return true; |
| 91 return false; | 91 return false; |
| 92 } | 92 } |
| OLD | NEW |