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

Side by Side Diff: chrome/browser/ui/startup/default_browser_infobar_delegate.h

Issue 2139753002: Now correctly tracks the case where the default browser prompt is ignored. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_UI_STARTUP_DEFAULT_BROWSER_INFOBAR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_STARTUP_DEFAULT_BROWSER_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_UI_STARTUP_DEFAULT_BROWSER_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_STARTUP_DEFAULT_BROWSER_INFOBAR_DELEGATE_H_
7 7
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "chrome/browser/infobars/infobar_service.h" 9 #include "chrome/browser/infobars/infobar_service.h"
10 #include "chrome/browser/shell_integration.h" 10 #include "chrome/browser/shell_integration.h"
(...skipping 28 matching lines...) Expand all
39 private: 39 private:
40 // Possible user interactions with the default browser info bar. 40 // Possible user interactions with the default browser info bar.
41 // Do not modify the ordering as it is important for UMA. 41 // Do not modify the ordering as it is important for UMA.
42 enum InfoBarUserInteraction { 42 enum InfoBarUserInteraction {
43 // The user clicked the "OK" (i.e., "Set as default") button. 43 // The user clicked the "OK" (i.e., "Set as default") button.
44 ACCEPT_INFO_BAR = 0, 44 ACCEPT_INFO_BAR = 0,
45 // The user clicked the "Cancel" (i.e., "Don't ask again") button. 45 // The user clicked the "Cancel" (i.e., "Don't ask again") button.
46 CANCEL_INFO_BAR = 1, 46 CANCEL_INFO_BAR = 1,
47 // The user did not interact with the info bar. 47 // The user did not interact with the info bar.
48 IGNORE_INFO_BAR = 2, 48 IGNORE_INFO_BAR = 2,
49 // The user explicitly closed the infobar.
50 DISMISS_INFO_BAR = 3,
49 NUM_INFO_BAR_USER_INTERACTION_TYPES 51 NUM_INFO_BAR_USER_INTERACTION_TYPES
50 }; 52 };
51 53
52 void AllowExpiry(); 54 void AllowExpiry();
53 55
54 // ConfirmInfoBarDelegate: 56 // ConfirmInfoBarDelegate:
55 Type GetInfoBarType() const override; 57 Type GetInfoBarType() const override;
56 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; 58 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
57 int GetIconId() const override; 59 int GetIconId() const override;
58 gfx::VectorIconId GetVectorIconId() const override; 60 gfx::VectorIconId GetVectorIconId() const override;
(...skipping 19 matching lines...) Expand all
78 void OnSetAsDefaultFinished(shell_integration::DefaultWebClientState state); 80 void OnSetAsDefaultFinished(shell_integration::DefaultWebClientState state);
79 81
80 // The WebContents's corresponding profile. 82 // The WebContents's corresponding profile.
81 Profile* profile_; 83 Profile* profile_;
82 84
83 scoped_refptr<base::SingleThreadTaskRunner> thread_task_runner_; 85 scoped_refptr<base::SingleThreadTaskRunner> thread_task_runner_;
84 86
85 // Whether the info bar should be dismissed on the next navigation. 87 // Whether the info bar should be dismissed on the next navigation.
86 bool should_expire_; 88 bool should_expire_;
87 89
90 // Indicates if the user interacted with the infobar.
91 bool action_taken_;
92
88 // Used to delay the expiration of the info-bar. 93 // Used to delay the expiration of the info-bar.
89 base::WeakPtrFactory<DefaultBrowserInfoBarDelegate> weak_factory_; 94 base::WeakPtrFactory<DefaultBrowserInfoBarDelegate> weak_factory_;
90 95
91 DISALLOW_COPY_AND_ASSIGN(DefaultBrowserInfoBarDelegate); 96 DISALLOW_COPY_AND_ASSIGN(DefaultBrowserInfoBarDelegate);
92 }; 97 };
93 98
94 } // namespace chrome 99 } // namespace chrome
95 100
96 #endif // CHROME_BROWSER_UI_STARTUP_DEFAULT_BROWSER_INFOBAR_DELEGATE_H_ 101 #endif // CHROME_BROWSER_UI_STARTUP_DEFAULT_BROWSER_INFOBAR_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/startup/default_browser_infobar_delegate.cc » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698