Chromium Code Reviews| Index: chrome/browser/ui/views/proximity_auth/proximity_auth_error_bubble_view.h |
| diff --git a/chrome/browser/ui/views/proximity_auth/proximity_auth_error_bubble_view.h b/chrome/browser/ui/views/proximity_auth/proximity_auth_error_bubble_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..58af2d7e9416b8cd7e3aac3a1db67f95363aea24 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/proximity_auth/proximity_auth_error_bubble_view.h |
| @@ -0,0 +1,53 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_VIEWS_PROXIMITY_AUTH_PROXIMITY_AUTH_ERROR_BUBBLE_VIEW_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_PROXIMITY_AUTH_PROXIMITY_AUTH_ERROR_BUBBLE_VIEW_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/strings/string16.h" |
| +#include "content/public/browser/web_contents_observer.h" |
| +#include "ui/views/bubble/bubble_delegate.h" |
| +#include "ui/views/controls/styled_label_listener.h" |
| +#include "url/gurl.h" |
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +namespace gfx { |
| +class Range; |
| +class Rect; |
| +} |
| + |
| +class ProximityAuthErrorBubbleView : public content::WebContentsObserver, |
|
Tim Song
2015/01/15 19:29:24
Do you need to implement content::WebContentsObser
Ilya Sherman
2015/01/16 05:39:42
I call web_contents(), which is null when the WebC
|
| + public views::BubbleDelegateView, |
| + public views::StyledLabelListener { |
| + public: |
| + // Shows an error bubble with the given |message|, with an arrow pointing to |
| + // the |anchor_rect|. If the |link_range| is non-empty, then that range of the |
| + // |message| is drawn as a link with |link_url| as the target. When the link |
| + // is clicked, the target URL opens in a new tab off of the given |
| + // |web_contents|. |
| + ProximityAuthErrorBubbleView(const base::string16& message, |
| + const gfx::Range& link_range, |
| + const GURL& link_url, |
| + const gfx::Rect& anchor_rect, |
| + content::WebContents* web_contents); |
| + |
| + private: |
| + ~ProximityAuthErrorBubbleView() override; |
| + |
| + // StyledLabelListener: |
| + void StyledLabelLinkClicked(const gfx::Range& range, |
| + int event_flags) override; |
| + |
| + // The target URL of the link shown in the bubble's error message. Ignored if |
| + // there is no link. |
| + const GURL link_url_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ProximityAuthErrorBubbleView); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_PROXIMITY_AUTH_PROXIMITY_AUTH_ERROR_BUBBLE_VIEW_H_ |