| OLD | NEW |
| 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/renderer/extensions/extension_helper.h" | 5 #include "chrome/renderer/extensions/extension_helper.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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 // chrome.tabs.executeScript() only supports execution in either the top frame | 317 // chrome.tabs.executeScript() only supports execution in either the top frame |
| 318 // or all frames. We handle both cases in the top frame. | 318 // or all frames. We handle both cases in the top frame. |
| 319 SchedulerMap::iterator i = g_schedulers.Get().find(main_frame); | 319 SchedulerMap::iterator i = g_schedulers.Get().find(main_frame); |
| 320 if (i != g_schedulers.Get().end()) | 320 if (i != g_schedulers.Get().end()) |
| 321 i->second->ExecuteCode(params); | 321 i->second->ExecuteCode(params); |
| 322 } | 322 } |
| 323 | 323 |
| 324 void ExtensionHelper::OnGetApplicationInfo(int page_id) { | 324 void ExtensionHelper::OnGetApplicationInfo(int page_id) { |
| 325 WebApplicationInfo app_info; | 325 WebApplicationInfo app_info; |
| 326 if (page_id == render_view()->GetPageId()) { | 326 if (page_id == render_view()->GetPageId()) { |
| 327 string16 error; | 327 base::string16 error; |
| 328 web_apps::ParseWebAppFromWebDocument( | 328 web_apps::ParseWebAppFromWebDocument( |
| 329 render_view()->GetWebView()->mainFrame(), &app_info, &error); | 329 render_view()->GetWebView()->mainFrame(), &app_info, &error); |
| 330 } | 330 } |
| 331 | 331 |
| 332 // Prune out any data URLs in the set of icons. The browser process expects | 332 // Prune out any data URLs in the set of icons. The browser process expects |
| 333 // any icon with a data URL to have originated from a favicon. We don't want | 333 // any icon with a data URL to have originated from a favicon. We don't want |
| 334 // to decode arbitrary data URLs in the browser process. See | 334 // to decode arbitrary data URLs in the browser process. See |
| 335 // http://b/issue?id=1162972 | 335 // http://b/issue?id=1162972 |
| 336 for (size_t i = 0; i < app_info.icons.size(); ++i) { | 336 for (size_t i = 0; i < app_info.icons.size(); ++i) { |
| 337 if (app_info.icons[i].url.SchemeIs(chrome::kDataScheme)) { | 337 if (app_info.icons[i].url.SchemeIs(chrome::kDataScheme)) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); | 369 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); |
| 370 ChromeV8Context* chrome_v8_context = | 370 ChromeV8Context* chrome_v8_context = |
| 371 dispatcher_->v8_context_set().GetByV8Context(script_context); | 371 dispatcher_->v8_context_set().GetByV8Context(script_context); |
| 372 if (!chrome_v8_context) | 372 if (!chrome_v8_context) |
| 373 return; | 373 return; |
| 374 chrome_v8_context->module_system()->CallModuleMethod( | 374 chrome_v8_context->module_system()->CallModuleMethod( |
| 375 "app.window", "onAppWindowClosed"); | 375 "app.window", "onAppWindowClosed"); |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace extensions | 378 } // namespace extensions |
| OLD | NEW |