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

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

Issue 104493005: Update some uses of Value in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years 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
« no previous file with comments | « chrome/browser/guestview/guestview.h ('k') | chrome/browser/guestview/webview/webview_guest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/guestview.h" 5 #include "chrome/browser/guestview/guestview.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "chrome/browser/guestview/adview/adview_guest.h" 8 #include "chrome/browser/guestview/adview/adview_guest.h"
9 #include "chrome/browser/guestview/guestview_constants.h" 9 #include "chrome/browser/guestview/guestview_constants.h"
10 #include "chrome/browser/guestview/webview/webview_guest.h" 10 #include "chrome/browser/guestview/webview/webview_guest.h"
(...skipping 14 matching lines...) Expand all
25 static base::LazyInstance<EmbedderGuestViewMap> embedder_guestview_map = 25 static base::LazyInstance<EmbedderGuestViewMap> embedder_guestview_map =
26 LAZY_INSTANCE_INITIALIZER; 26 LAZY_INSTANCE_INITIALIZER;
27 27
28 typedef std::map<WebContents*, GuestView*> WebContentsGuestViewMap; 28 typedef std::map<WebContents*, GuestView*> WebContentsGuestViewMap;
29 static base::LazyInstance<WebContentsGuestViewMap> webcontents_guestview_map = 29 static base::LazyInstance<WebContentsGuestViewMap> webcontents_guestview_map =
30 LAZY_INSTANCE_INITIALIZER; 30 LAZY_INSTANCE_INITIALIZER;
31 31
32 } // namespace 32 } // namespace
33 33
34 GuestView::Event::Event(const std::string& name, 34 GuestView::Event::Event(const std::string& name,
35 scoped_ptr<DictionaryValue> args) 35 scoped_ptr<base::DictionaryValue> args)
36 : name_(name), 36 : name_(name),
37 args_(args.Pass()) { 37 args_(args.Pass()) {
38 } 38 }
39 39
40 GuestView::Event::~Event() { 40 GuestView::Event::~Event() {
41 } 41 }
42 42
43 scoped_ptr<DictionaryValue> GuestView::Event::GetArguments() { 43 scoped_ptr<base::DictionaryValue> GuestView::Event::GetArguments() {
44 return args_.Pass(); 44 return args_.Pass();
45 } 45 }
46 46
47 GuestView::GuestView(WebContents* guest_web_contents, 47 GuestView::GuestView(WebContents* guest_web_contents,
48 const std::string& extension_id) 48 const std::string& extension_id)
49 : guest_web_contents_(guest_web_contents), 49 : guest_web_contents_(guest_web_contents),
50 embedder_web_contents_(NULL), 50 embedder_web_contents_(NULL),
51 extension_id_(extension_id), 51 extension_id_(extension_id),
52 embedder_render_process_id_(0), 52 embedder_render_process_id_(0),
53 browser_context_(guest_web_contents->GetBrowserContext()), 53 browser_context_(guest_web_contents->GetBrowserContext()),
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 if (!attached()) { 188 if (!attached()) {
189 pending_events_.push(event); 189 pending_events_.push(event);
190 return; 190 return;
191 } 191 }
192 192
193 Profile* profile = Profile::FromBrowserContext(browser_context_); 193 Profile* profile = Profile::FromBrowserContext(browser_context_);
194 194
195 extensions::EventFilteringInfo info; 195 extensions::EventFilteringInfo info;
196 info.SetURL(GURL()); 196 info.SetURL(GURL());
197 info.SetInstanceID(guest_instance_id_); 197 info.SetInstanceID(guest_instance_id_);
198 scoped_ptr<ListValue> args(new ListValue()); 198 scoped_ptr<base::ListValue> args(new base::ListValue());
199 args->Append(event->GetArguments().release()); 199 args->Append(event->GetArguments().release());
200 200
201 extensions::EventRouter::DispatchEvent( 201 extensions::EventRouter::DispatchEvent(
202 embedder_web_contents_, profile, extension_id_, 202 embedder_web_contents_, profile, extension_id_,
203 event->name(), args.Pass(), 203 event->name(), args.Pass(),
204 extensions::EventRouter::USER_GESTURE_UNKNOWN, info); 204 extensions::EventRouter::USER_GESTURE_UNKNOWN, info);
205 205
206 delete event; 206 delete event;
207 } 207 }
208 208
209 void GuestView::SendQueuedEvents() { 209 void GuestView::SendQueuedEvents() {
210 if (!attached()) 210 if (!attached())
211 return; 211 return;
212 212
213 while (!pending_events_.empty()) { 213 while (!pending_events_.empty()) {
214 Event* event = pending_events_.front(); 214 Event* event = pending_events_.front();
215 pending_events_.pop(); 215 pending_events_.pop();
216 DispatchEvent(event); 216 DispatchEvent(event);
217 } 217 }
218 } 218 }
OLDNEW
« no previous file with comments | « chrome/browser/guestview/guestview.h ('k') | chrome/browser/guestview/webview/webview_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698