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

Side by Side Diff: chrome/browser/guestview/adview/adview_guest.cc

Issue 27408004: <webview>: Resolve relative paths as chrome-extension: URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed creis's comments Created 7 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/guestview/adview/adview_guest.h" 5 #include "chrome/browser/guestview/adview/adview_guest.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "chrome/browser/guestview/adview/adview_constants.h" 8 #include "chrome/browser/guestview/adview/adview_constants.h"
9 #include "chrome/browser/guestview/guestview_constants.h" 9 #include "chrome/browser/guestview/guestview_constants.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
11 #include "net/base/net_errors.h" 11 #include "net/base/net_errors.h"
12 12
13 using content::WebContents; 13 using content::WebContents;
14 14
15 AdViewGuest::AdViewGuest(WebContents* guest_web_contents) 15 AdViewGuest::AdViewGuest(WebContents* guest_web_contents,
16 : GuestView(guest_web_contents), 16 const std::string& extension_id)
17 : GuestView(guest_web_contents, extension_id),
17 WebContentsObserver(guest_web_contents) { 18 WebContentsObserver(guest_web_contents) {
18 } 19 }
19 20
20 // static 21 // static
21 AdViewGuest* AdViewGuest::From(int embedder_process_id, 22 AdViewGuest* AdViewGuest::From(int embedder_process_id,
22 int guest_instance_id) { 23 int guest_instance_id) {
23 GuestView* guest = GuestView::From(embedder_process_id, guest_instance_id); 24 GuestView* guest = GuestView::From(embedder_process_id, guest_instance_id);
24 if (!guest) 25 if (!guest)
25 return NULL; 26 return NULL;
26 return guest->AsAdView(); 27 return guest->AsAdView();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // Translate the |error_code| into an error string. 66 // Translate the |error_code| into an error string.
66 std::string error_type; 67 std::string error_type;
67 RemoveChars(net::ErrorToString(error_code), "net::", &error_type); 68 RemoveChars(net::ErrorToString(error_code), "net::", &error_type);
68 69
69 scoped_ptr<DictionaryValue> args(new DictionaryValue()); 70 scoped_ptr<DictionaryValue> args(new DictionaryValue());
70 args->SetBoolean(guestview::kIsTopLevel, is_main_frame); 71 args->SetBoolean(guestview::kIsTopLevel, is_main_frame);
71 args->SetString(guestview::kUrl, validated_url.spec()); 72 args->SetString(guestview::kUrl, validated_url.spec());
72 args->SetString(guestview::kReason, error_type); 73 args->SetString(guestview::kReason, error_type);
73 DispatchEvent(new GuestView::Event(adview::kEventLoadAbort, args.Pass())); 74 DispatchEvent(new GuestView::Event(adview::kEventLoadAbort, args.Pass()));
74 } 75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698