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

Side by Side Diff: chrome/browser/ui/website_settings/chooser_bubble_controller.h

Issue 1892293003: Display origin url on the chooser permission dialog title (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address palmer@'s comments Created 4 years, 8 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 CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_CONTROLLER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "components/bubble/bubble_delegate.h" 12 #include "components/bubble/bubble_delegate.h"
13 13
14 class Browser; 14 class Browser;
15 class GURL; 15 class GURL;
16 16
17 namespace url {
18 class Origin;
19 }
20
17 // Subclass ChooserBubbleController to implement a chooser bubble, which has 21 // Subclass ChooserBubbleController to implement a chooser bubble, which has
18 // some introductory text and a list of options that users can pick one of. 22 // some introductory text and a list of options that users can pick one of.
19 // Create an instance of your subclass and pass it to 23 // Create an instance of your subclass and pass it to
20 // BubbleManager::ShowBubble() to show the bubble. Your subclass must define 24 // BubbleManager::ShowBubble() to show the bubble. Your subclass must define
21 // the set of options users can pick from; the actions taken after users 25 // the set of options users can pick from; the actions taken after users
22 // select an item or press the 'Cancel' button or the bubble is closed. 26 // select an item or press the 'Cancel' button or the bubble is closed.
23 // You can also override GetName() to identify the bubble you define for 27 // You can also override GetName() to identify the bubble you define for
24 // collecting metrics. 28 // collecting metrics.
25 // After Select/Cancel/Close is called, this object is destroyed and call back 29 // After Select/Cancel/Close is called, this object is destroyed and call back
26 // into it is not allowed. 30 // into it is not allowed.
(...skipping 19 matching lines...) Expand all
46 // Called when GetOption(index) is no longer present, and all later 50 // Called when GetOption(index) is no longer present, and all later
47 // options have been moved earlier by 1 slot. Calling GetOption(index) 51 // options have been moved earlier by 1 slot. Calling GetOption(index)
48 // from inside a call to OnOptionRemoved will NOT see the removed string 52 // from inside a call to OnOptionRemoved will NOT see the removed string
49 // since the options have already been updated. 53 // since the options have already been updated.
50 virtual void OnOptionRemoved(size_t index) = 0; 54 virtual void OnOptionRemoved(size_t index) = 0;
51 55
52 protected: 56 protected:
53 virtual ~Observer() {} 57 virtual ~Observer() {}
54 }; 58 };
55 59
60 // Return the origin URL to be displayed on the bubble title.
61 url::Origin GetOriginUrl() const;
palmer 2016/04/18 21:13:59 Nit: I'd probably name this simply |GetOrigin|.
juncai 2016/04/18 21:20:36 Done.
62
56 // Open help center URL. 63 // Open help center URL.
57 void OpenHelpCenterUrl() const; 64 void OpenHelpCenterUrl() const;
58 65
59 // BubbleDelegate: 66 // BubbleDelegate:
60 std::string GetName() const override; 67 std::string GetName() const override;
61 std::unique_ptr<BubbleUi> BuildBubbleUi() override; 68 std::unique_ptr<BubbleUi> BuildBubbleUi() override;
62 const content::RenderFrameHost* OwningFrame() const override; 69 const content::RenderFrameHost* OwningFrame() const override;
63 70
64 // The number of options users can pick from. For example, it can be 71 // The number of options users can pick from. For example, it can be
65 // the number of USB/Bluetooth device names which are listed in the 72 // the number of USB/Bluetooth device names which are listed in the
(...skipping 24 matching lines...) Expand all
90 97
91 private: 98 private:
92 Browser* browser_; 99 Browser* browser_;
93 const content::RenderFrameHost* const owning_frame_; 100 const content::RenderFrameHost* const owning_frame_;
94 Observer* observer_ = nullptr; 101 Observer* observer_ = nullptr;
95 102
96 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleController); 103 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleController);
97 }; 104 };
98 105
99 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_CONTROLLER_H_ 106 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698