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

Side by Side Diff: chrome/browser/chromeos/arc/arc_intent_helper_bridge.cc

Issue 1662783002: Remove HostDesktopType from Browser::CreateParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-12
Patch Set: remove desktop_type_ in bookmark_bubble_sign_in_delegate 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chromeos/arc/arc_intent_helper_bridge.h" 5 #include "chrome/browser/chromeos/arc/arc_intent_helper_bridge.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "chrome/browser/profiles/profile_manager.h" 8 #include "chrome/browser/profiles/profile_manager.h"
9 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" 9 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 22 matching lines...) Expand all
33 void ArcIntentHelperBridge::OnIntentHelperInstanceClosed() { 33 void ArcIntentHelperBridge::OnIntentHelperInstanceClosed() {
34 settings_bridge_.reset(); 34 settings_bridge_.reset();
35 } 35 }
36 36
37 void ArcIntentHelperBridge::OnOpenUrl(const mojo::String& url) { 37 void ArcIntentHelperBridge::OnOpenUrl(const mojo::String& url) {
38 GURL gurl(url.get()); 38 GURL gurl(url.get());
39 if (!gurl.is_valid()) 39 if (!gurl.is_valid())
40 return; 40 return;
41 41
42 chrome::ScopedTabbedBrowserDisplayer displayer( 42 chrome::ScopedTabbedBrowserDisplayer displayer(
43 ProfileManager::GetActiveUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); 43 ProfileManager::GetActiveUserProfile());
44 chrome::AddSelectedTabWithURL(displayer.browser(), gurl, 44 chrome::AddSelectedTabWithURL(displayer.browser(), gurl,
45 ui::PAGE_TRANSITION_LINK); 45 ui::PAGE_TRANSITION_LINK);
46 46
47 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the 47 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the
48 // browser will be shown on the active desktop, we ensure the visibility. 48 // browser will be shown on the active desktop, we ensure the visibility.
49 multi_user_util::MoveWindowToCurrentDesktop( 49 multi_user_util::MoveWindowToCurrentDesktop(
50 displayer.browser()->window()->GetNativeWindow()); 50 displayer.browser()->window()->GetNativeWindow());
51 } 51 }
52 52
53 void ArcIntentHelperBridge::OnBroadcastNeeded( 53 void ArcIntentHelperBridge::OnBroadcastNeeded(
54 const std::string& action, 54 const std::string& action,
55 const base::DictionaryValue& extras) { 55 const base::DictionaryValue& extras) {
56 if (arc_bridge_service()->state() != ArcBridgeService::State::READY) { 56 if (arc_bridge_service()->state() != ArcBridgeService::State::READY) {
57 LOG(ERROR) << "Bridge service is not ready."; 57 LOG(ERROR) << "Bridge service is not ready.";
58 return; 58 return;
59 } 59 }
60 60
61 std::string extras_json; 61 std::string extras_json;
62 bool write_success = base::JSONWriter::Write(extras, &extras_json); 62 bool write_success = base::JSONWriter::Write(extras, &extras_json);
63 DCHECK(write_success); 63 DCHECK(write_success);
64 64
65 if (arc_bridge_service()->intent_helper_version() >= 1) { 65 if (arc_bridge_service()->intent_helper_version() >= 1) {
66 arc_bridge_service()->intent_helper_instance()->SendBroadcast( 66 arc_bridge_service()->intent_helper_instance()->SendBroadcast(
67 action, "org.chromium.arc.intent_helper", 67 action, "org.chromium.arc.intent_helper",
68 "org.chromium.arc.intent_helper.SettingsReceiver", extras_json); 68 "org.chromium.arc.intent_helper.SettingsReceiver", extras_json);
69 } 69 }
70 } 70 }
71 71
72 } // namespace arc 72 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chrome_webusb_browser_client.cc ('k') | chrome/browser/chromeos/drive/file_task_executor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698