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

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 1220813003: Fix flakiness and re-enable FormAutocompleteTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check null Created 5 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
« no previous file with comments | « chrome/renderer/autofill/form_autocomplete_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 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 "extensions/renderer/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // using Chrome styles, then insert the Chrome extension stylesheet. 354 // using Chrome styles, then insert the Chrome extension stylesheet.
355 if (extension && extension->is_extension() && 355 if (extension && extension->is_extension() &&
356 OptionsPageInfo::ShouldUseChromeStyle(extension) && 356 OptionsPageInfo::ShouldUseChromeStyle(extension) &&
357 effective_document_url == OptionsPageInfo::GetOptionsPage(extension)) { 357 effective_document_url == OptionsPageInfo::GetOptionsPage(extension)) {
358 frame->document().insertStyleSheet( 358 frame->document().insertStyleSheet(
359 WebString::fromUTF8(ResourceBundle::GetSharedInstance() 359 WebString::fromUTF8(ResourceBundle::GetSharedInstance()
360 .GetRawDataResource(IDR_EXTENSION_CSS) 360 .GetRawDataResource(IDR_EXTENSION_CSS)
361 .as_string())); 361 .as_string()));
362 } 362 }
363 363
364 content_watcher_->DidCreateDocumentElement(frame); 364 if (content_watcher_) {
not at google - send to devlin 2015/07/06 16:32:46 Comment here and below, // This can happen if the
kouhei (in TOK) 2015/07/07 00:00:29 ack
not at google - send to devlin 2015/07/07 19:55:51 Alright, let's go with what you have and contrary
kouhei (in TOK) 2015/07/08 09:23:32 Done.
365 content_watcher_->DidCreateDocumentElement(frame);
366 }
365 } 367 }
366 368
367 void Dispatcher::DidMatchCSS( 369 void Dispatcher::DidMatchCSS(
368 blink::WebFrame* frame, 370 blink::WebFrame* frame,
369 const blink::WebVector<blink::WebString>& newly_matching_selectors, 371 const blink::WebVector<blink::WebString>& newly_matching_selectors,
370 const blink::WebVector<blink::WebString>& stopped_matching_selectors) { 372 const blink::WebVector<blink::WebString>& stopped_matching_selectors) {
371 content_watcher_->DidMatchCSS( 373 if (content_watcher_) {
372 frame, newly_matching_selectors, stopped_matching_selectors); 374 content_watcher_->DidMatchCSS(
375 frame, newly_matching_selectors, stopped_matching_selectors);
376 }
373 } 377 }
374 378
375 void Dispatcher::OnExtensionResponse(int request_id, 379 void Dispatcher::OnExtensionResponse(int request_id,
376 bool success, 380 bool success,
377 const base::ListValue& response, 381 const base::ListValue& response,
378 const std::string& error) { 382 const std::string& error) {
379 request_sender_->HandleResponse(request_id, success, response, error); 383 request_sender_->HandleResponse(request_id, success, response, error);
380 } 384 }
381 385
382 void Dispatcher::DispatchEvent(const std::string& extension_id, 386 void Dispatcher::DispatchEvent(const std::string& extension_id,
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 // The "guestViewDeny" module must always be loaded last. It registers 1446 // The "guestViewDeny" module must always be loaded last. It registers
1443 // error-providing custom elements for the GuestView types that are not 1447 // error-providing custom elements for the GuestView types that are not
1444 // available, and thus all of those types must have been checked and loaded 1448 // available, and thus all of those types must have been checked and loaded
1445 // (or not loaded) beforehand. 1449 // (or not loaded) beforehand.
1446 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1450 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1447 module_system->Require("guestViewDeny"); 1451 module_system->Require("guestViewDeny");
1448 } 1452 }
1449 } 1453 }
1450 1454
1451 } // namespace extensions 1455 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/autofill/form_autocomplete_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698