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

Side by Side Diff: content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h

Issue 1672103002: Pass the frame instead of the WebContents through RunBluetoothChooser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@doc-bubble-lifetimes
Patch Set: Sync Created 4 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTORY_ H_ 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTORY_ H_
6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTORY_ H_ 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTORY_ H_
7 7
8 #include "content/public/browser/bluetooth_chooser.h" 8 #include "content/public/browser/bluetooth_chooser.h"
9 9
10 #include <set> 10 #include <set>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "content/public/browser/bluetooth_chooser.h" 14 #include "content/public/browser/bluetooth_chooser.h"
15 15
16 namespace url { 16 namespace url {
17 class Origin; 17 class Origin;
18 } 18 }
19 19
20 namespace content { 20 namespace content {
21 21
22 class WebContents; 22 class RenderFrameHost;
23 23
24 class LayoutTestBluetoothChooserFactory { 24 class LayoutTestBluetoothChooserFactory {
25 public: 25 public:
26 LayoutTestBluetoothChooserFactory(); 26 LayoutTestBluetoothChooserFactory();
27 ~LayoutTestBluetoothChooserFactory(); 27 ~LayoutTestBluetoothChooserFactory();
28 28
29 scoped_ptr<BluetoothChooser> RunBluetoothChooser( 29 scoped_ptr<BluetoothChooser> RunBluetoothChooser(
30 WebContents* web_contents, 30 RenderFrameHost* frame,
31 const BluetoothChooser::EventHandler& event_handler, 31 const BluetoothChooser::EventHandler& event_handler,
32 const url::Origin& origin); 32 const url::Origin& origin);
33 33
34 std::vector<std::string> GetAndResetEvents(); 34 std::vector<std::string> GetAndResetEvents();
35 35
36 void SendEvent(BluetoothChooser::Event event, const std::string& device_id); 36 void SendEvent(BluetoothChooser::Event event, const std::string& device_id);
37 37
38 private: 38 private:
39 class Chooser; 39 class Chooser;
40 40
41 std::vector<std::string> events_; 41 std::vector<std::string> events_;
42 42
43 // Contains the set of live choosers, in order to send them events. 43 // Contains the set of live choosers, in order to send them events.
44 std::set<Chooser*> choosers_; 44 std::set<Chooser*> choosers_;
45 45
46 base::WeakPtrFactory<LayoutTestBluetoothChooserFactory> weak_this_; 46 base::WeakPtrFactory<LayoutTestBluetoothChooserFactory> weak_this_;
47 }; 47 };
48 48
49 } // namespace content 49 } // namespace content
50 50
51 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTO RY_H_ 51 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTO RY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698