Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SHELL_INTEGRATION_H_ | 5 #ifndef CHROME_BROWSER_SHELL_INTEGRATION_H_ |
| 6 #define CHROME_BROWSER_SHELL_INTEGRATION_H_ | 6 #define CHROME_BROWSER_SHELL_INTEGRATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 using DefaultWebClientWorkerCallback = | 127 using DefaultWebClientWorkerCallback = |
| 128 base::Callback<void(DefaultWebClientState)>; | 128 base::Callback<void(DefaultWebClientState)>; |
| 129 | 129 |
| 130 // Helper objects that handle checking if Chrome is the default browser | 130 // Helper objects that handle checking if Chrome is the default browser |
| 131 // or application for a url protocol on Windows and Linux, and also setting | 131 // or application for a url protocol on Windows and Linux, and also setting |
| 132 // it as the default. These operations are performed asynchronously on the | 132 // it as the default. These operations are performed asynchronously on the |
| 133 // file thread since registry access (on Windows) or the preference database | 133 // file thread since registry access (on Windows) or the preference database |
| 134 // (on Linux) are involved and this can be slow. | 134 // (on Linux) are involved and this can be slow. |
| 135 // By default, the worker will present the user with an interactive flow if | 135 // By default, the worker will present the user with an interactive flow if |
| 136 // required by the platform. This can be suppressed via | 136 // required by the platform. This can be suppressed via |
| 137 // set_interactive_permitted(), in which case an attempt to set Chrome as | 137 // set_can_process_events_within_subtree_permitted(), in which case an attempt |
|
sky
2017/02/24 21:32:33
optional: remove '_permitted'. It's unnecessary an
Evan Stade
2017/02/24 21:39:10
oops, this was an overzealous find/replace. I've j
| |
| 138 // the default handler will silently fail on such platforms. | 138 // to set Chrome as the default handler will silently fail on such platforms. |
| 139 class DefaultWebClientWorker | 139 class DefaultWebClientWorker |
| 140 : public base::RefCountedThreadSafe<DefaultWebClientWorker> { | 140 : public base::RefCountedThreadSafe<DefaultWebClientWorker> { |
| 141 public: | 141 public: |
| 142 // Controls whether the worker can use user interaction to set the default | 142 // Controls whether the worker can use user interaction to set the default |
| 143 // web client. If false, the set-as-default operation will fail on OS where | 143 // web client. If false, the set-as-default operation will fail on OS where |
| 144 // it is required. | 144 // it is required. |
| 145 void set_interactive_permitted(bool interactive_permitted) { | 145 void set_can_process_events_within_subtree_permitted( |
| 146 bool interactive_permitted) { | |
| 146 interactive_permitted_ = interactive_permitted; | 147 interactive_permitted_ = interactive_permitted; |
| 147 } | 148 } |
| 148 | 149 |
| 149 // Checks to see if Chrome is the default web client application. The | 150 // Checks to see if Chrome is the default web client application. The |
| 150 // instance's callback will be run to communicate the default state to the | 151 // instance's callback will be run to communicate the default state to the |
| 151 // caller. | 152 // caller. |
| 152 void StartCheckIsDefault(); | 153 void StartCheckIsDefault(); |
| 153 | 154 |
| 154 // Sets Chrome as the default web client application. Once done, it will | 155 // Sets Chrome as the default web client application. Once done, it will |
| 155 // trigger a check for the default state using StartCheckIsDefault() to return | 156 // trigger a check for the default state using StartCheckIsDefault() to return |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 void SetAsDefaultImpl(const base::Closure& on_finished_callback) override; | 249 void SetAsDefaultImpl(const base::Closure& on_finished_callback) override; |
| 249 | 250 |
| 250 std::string protocol_; | 251 std::string protocol_; |
| 251 | 252 |
| 252 DISALLOW_COPY_AND_ASSIGN(DefaultProtocolClientWorker); | 253 DISALLOW_COPY_AND_ASSIGN(DefaultProtocolClientWorker); |
| 253 }; | 254 }; |
| 254 | 255 |
| 255 } // namespace shell_integration | 256 } // namespace shell_integration |
| 256 | 257 |
| 257 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_ | 258 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_ |
| OLD | NEW |