summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/intents/web_intent_picker.h
blob: 0c49099f9806a93485cade244816401d8ec19104 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) 2011 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_INTENTS_WEB_INTENT_PICKER_H_
#define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_
#pragma once

#include <stddef.h>
#include <vector>

class Browser;
class GURL;
class SkBitmap;
class TabContents;
class TabContentsWrapper;
class WebIntentPickerDelegate;

// Base class for the web intent picker dialog.
class WebIntentPicker {
 public:
  class Delegate;

  // Platform specific factory function. This function will automatically show
  // the picker.
  static WebIntentPicker* Create(Browser* browser,
                                 TabContentsWrapper* wrapper,
                                 WebIntentPickerDelegate* delegate);

  // Initalizes this picker with the |urls|.
  virtual void SetServiceURLs(const std::vector<GURL>& urls) = 0;

  // Sets the icon for a service at |index|.
  virtual void SetServiceIcon(size_t index, const SkBitmap& icon) = 0;

  // Sets the icon for a service at |index| to be the default favicon.
  virtual void SetDefaultServiceIcon(size_t index) = 0;

  // Hides the UI for this picker, and destroys its UI.
  virtual void Close() = 0;

  // Show the inline disposition UI for the given URL.
  virtual TabContents* SetInlineDisposition(const GURL& url) = 0;

 protected:
  virtual ~WebIntentPicker() {}
};

#endif  // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_