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

Side by Side Diff: chrome/browser/chooser_controller/chooser_controller.h

Issue 2126873003: Change WebBluetooth chooser title to "pair with" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@support_chrome_extension_chooser_title
Patch Set: address comment Created 4 years, 5 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 #ifndef CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_
6 #define CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_ 6 #define CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 10
11 namespace content { 11 namespace content {
12 class RenderFrameHost; 12 class RenderFrameHost;
13 } 13 }
14 14
15 // Subclass ChooserController to implement a chooser, which has some 15 // Subclass ChooserController to implement a chooser, which has some
16 // introductory text and a list of options that users can pick one of. 16 // introductory text and a list of options that users can pick one of.
17 // Your subclass must define the set of options users can pick from; 17 // Your subclass must define the set of options users can pick from;
18 // the actions taken after users select an item or press the 'Cancel' 18 // the actions taken after users select an item or press the 'Cancel'
19 // button or the chooser is closed. 19 // button or the chooser is closed.
20 // After Select/Cancel/Close is called, this object is destroyed and 20 // After Select/Cancel/Close is called, this object is destroyed and
21 // calls back into it are not allowed. 21 // calls back into it are not allowed.
22 class ChooserController { 22 class ChooserController {
23 public: 23 public:
24 explicit ChooserController(content::RenderFrameHost* owner); 24 ChooserController(content::RenderFrameHost* owner,
25 int title_string_id_origin,
26 int title_string_id_extension);
25 virtual ~ChooserController(); 27 virtual ~ChooserController();
26 28
27 // Since the set of options can change while the UI is visible an 29 // Since the set of options can change while the UI is visible an
28 // implementation should register an observer. 30 // implementation should register an observer.
29 class Observer { 31 class Observer {
30 public: 32 public:
31 // Called after the options list is initialized for the first time. 33 // Called after the options list is initialized for the first time.
32 // OnOptionsInitialized should only be called once. 34 // OnOptionsInitialized should only be called once.
33 virtual void OnOptionsInitialized() = 0; 35 virtual void OnOptionsInitialized() = 0;
34 36
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 virtual void Close() = 0; 77 virtual void Close() = 0;
76 78
77 // Open help center URL. 79 // Open help center URL.
78 virtual void OpenHelpCenterUrl() const = 0; 80 virtual void OpenHelpCenterUrl() const = 0;
79 81
80 // Only one observer may be registered at a time. 82 // Only one observer may be registered at a time.
81 void set_observer(Observer* observer) { observer_ = observer; } 83 void set_observer(Observer* observer) { observer_ = observer; }
82 Observer* observer() const { return observer_; } 84 Observer* observer() const { return observer_; }
83 85
84 private: 86 private:
85 content::RenderFrameHost* owning_frame_; 87 content::RenderFrameHost* const owning_frame_;
88 const int title_string_id_origin_;
89 const int title_string_id_extension_;
86 Observer* observer_ = nullptr; 90 Observer* observer_ = nullptr;
87 91
88 DISALLOW_COPY_AND_ASSIGN(ChooserController); 92 DISALLOW_COPY_AND_ASSIGN(ChooserController);
89 }; 93 };
90 94
91 #endif // CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_ 95 #endif // CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/chooser_controller/chooser_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698