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

Side by Side Diff: chrome/browser/guest_view/ad_view/ad_view_guest.cc

Issue 296593003: Make various string_util functions take StringPieces instead of char[]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resync Created 6 years, 6 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 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 "chrome/browser/guest_view/ad_view/ad_view_guest.h" 5 #include "chrome/browser/guest_view/ad_view/ad_view_guest.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "chrome/browser/guest_view/ad_view/ad_view_constants.h" 8 #include "chrome/browser/guest_view/ad_view/ad_view_constants.h"
9 #include "chrome/browser/guest_view/guest_view_constants.h" 9 #include "chrome/browser/guest_view/guest_view_constants.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 void AdViewGuest::DidFailProvisionalLoad( 44 void AdViewGuest::DidFailProvisionalLoad(
45 int64 frame_id, 45 int64 frame_id,
46 const base::string16& frame_unique_name, 46 const base::string16& frame_unique_name,
47 bool is_main_frame, 47 bool is_main_frame,
48 const GURL& validated_url, 48 const GURL& validated_url,
49 int error_code, 49 int error_code,
50 const base::string16& error_description, 50 const base::string16& error_description,
51 content::RenderViewHost* render_view_host) { 51 content::RenderViewHost* render_view_host) {
52 // Translate the |error_code| into an error string. 52 // Translate the |error_code| into an error string.
53 std::string error_type; 53 std::string error_type(net::ErrorToString(error_code));
54 base::RemoveChars(net::ErrorToString(error_code), "net::", &error_type); 54 DCHECK(StartsWithASCII(error_type, "net::", true));
55 error_type.erase(0, 5);
55 56
56 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); 57 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
57 args->SetBoolean(guestview::kIsTopLevel, is_main_frame); 58 args->SetBoolean(guestview::kIsTopLevel, is_main_frame);
58 args->SetString(guestview::kUrl, validated_url.spec()); 59 args->SetString(guestview::kUrl, validated_url.spec());
59 args->SetString(guestview::kReason, error_type); 60 args->SetString(guestview::kReason, error_type);
60 DispatchEvent(new GuestViewBase::Event(adview::kEventLoadAbort, args.Pass())); 61 DispatchEvent(new GuestViewBase::Event(adview::kEventLoadAbort, args.Pass()));
61 } 62 }
OLDNEW
« no previous file with comments | « chrome/browser/errorpage_browsertest.cc ('k') | chrome/browser/guest_view/web_view/web_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698