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

Side by Side Diff: content/shell/browser/shell.cc

Issue 2658473002: Refactor BluetoothAllowedDevicesMap (Closed)
Patch Set: set --similarity=20 when did git cl upload Created 3 years, 11 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 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 "content/shell/browser/shell.h" 5 #include "content/shell/browser/shell.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ptr_util.h"
13 #include "base/run_loop.h" 14 #include "base/run_loop.h"
14 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
15 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
17 #include "base/strings/stringprintf.h" 18 #include "base/strings/stringprintf.h"
18 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
19 #include "base/threading/thread_task_runner_handle.h" 20 #include "base/threading/thread_task_runner_handle.h"
20 #include "build/build_config.h" 21 #include "build/build_config.h"
22 #include "content/public/browser/bluetooth_allowed_devices_map_base.h"
21 #include "content/public/browser/devtools_agent_host.h" 23 #include "content/public/browser/devtools_agent_host.h"
22 #include "content/public/browser/navigation_controller.h" 24 #include "content/public/browser/navigation_controller.h"
23 #include "content/public/browser/navigation_entry.h" 25 #include "content/public/browser/navigation_entry.h"
24 #include "content/public/browser/render_view_host.h" 26 #include "content/public/browser/render_view_host.h"
25 #include "content/public/browser/render_widget_host.h" 27 #include "content/public/browser/render_widget_host.h"
26 #include "content/public/browser/web_contents.h" 28 #include "content/public/browser/web_contents.h"
27 #include "content/public/browser/web_contents_observer.h" 29 #include "content/public/browser/web_contents_observer.h"
28 #include "content/public/common/content_switches.h" 30 #include "content/public/common/content_switches.h"
29 #include "content/public/common/renderer_preferences.h" 31 #include "content/public/common/renderer_preferences.h"
30 #include "content/public/common/webrtc_ip_handling_policy.h" 32 #include "content/public/common/webrtc_ip_handling_policy.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 std::unique_ptr<BluetoothChooser> Shell::RunBluetoothChooser( 456 std::unique_ptr<BluetoothChooser> Shell::RunBluetoothChooser(
455 RenderFrameHost* frame, 457 RenderFrameHost* frame,
456 const BluetoothChooser::EventHandler& event_handler) { 458 const BluetoothChooser::EventHandler& event_handler) {
457 if (switches::IsRunLayoutTestSwitchPresent()) { 459 if (switches::IsRunLayoutTestSwitchPresent()) {
458 return BlinkTestController::Get()->RunBluetoothChooser(frame, 460 return BlinkTestController::Get()->RunBluetoothChooser(frame,
459 event_handler); 461 event_handler);
460 } 462 }
461 return nullptr; 463 return nullptr;
462 } 464 }
463 465
466 BluetoothAllowedDevicesMapBase* Shell::GetBluetoothDevicesMap(
467 RenderFrameHost* frame) {
468 if (switches::IsRunLayoutTestSwitchPresent()) {
469 auto allowed_devices_map =
470 base::MakeUnique<BluetoothAllowedDevicesMapBase>();
471 bluetooth_allowed_devices_maps_.push_back(std::move(allowed_devices_map));
472 return bluetooth_allowed_devices_maps_.back().get();
473 }
474 return nullptr;
475 }
476
464 bool Shell::DidAddMessageToConsole(WebContents* source, 477 bool Shell::DidAddMessageToConsole(WebContents* source,
465 int32_t level, 478 int32_t level,
466 const base::string16& message, 479 const base::string16& message,
467 int32_t line_no, 480 int32_t line_no,
468 const base::string16& source_id) { 481 const base::string16& source_id) {
469 return switches::IsRunLayoutTestSwitchPresent(); 482 return switches::IsRunLayoutTestSwitchPresent();
470 } 483 }
471 484
472 void Shell::RendererUnresponsive( 485 void Shell::RendererUnresponsive(
473 WebContents* source, 486 WebContents* source,
(...skipping 28 matching lines...) Expand all
502 if (entry) 515 if (entry)
503 PlatformSetTitle(entry->GetTitle()); 516 PlatformSetTitle(entry->GetTitle());
504 } 517 }
505 518
506 void Shell::OnDevToolsWebContentsDestroyed() { 519 void Shell::OnDevToolsWebContentsDestroyed() {
507 devtools_observer_.reset(); 520 devtools_observer_.reset();
508 devtools_frontend_ = NULL; 521 devtools_frontend_ = NULL;
509 } 522 }
510 523
511 } // namespace content 524 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698