Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / views / extensions / browser_action_drag_data.h
blob563a04e4024fe3ea03199d5c7d8bcda793acb12f
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_BROWSER_ACTION_DRAG_DATA_H_
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_BROWSER_ACTION_DRAG_DATA_H_
8 #include <string>
10 #include "base/basictypes.h"
12 #if defined(TOOLKIT_VIEWS)
13 #include "ui/base/dragdrop/os_exchange_data.h"
14 #endif
16 class Pickle;
17 class Profile;
19 class BrowserActionDragData {
20 public:
21 BrowserActionDragData();
22 BrowserActionDragData(const std::string& id, int index);
24 const std::string& id() const { return id_; }
26 size_t index() const { return index_; }
28 // Returns true if this data is from the specified profile.
29 bool IsFromProfile(Profile* profile) const;
31 #if defined(TOOLKIT_VIEWS)
32 void Write(Profile* profile, ui::OSExchangeData* data) const;
34 // Restores this data from the clipboard, returning true on success.
35 bool Read(const ui::OSExchangeData& data);
37 // Returns the Custom Format this class supports (for Browser Actions).
38 static const ui::OSExchangeData::CustomFormat& GetBrowserActionCustomFormat();
39 #endif
41 private:
42 void WriteToPickle(Profile* profile, Pickle* pickle) const;
43 bool ReadFromPickle(Pickle* pickle);
45 // The profile we originated from.
46 void* profile_;
48 // The id of the view being dragged.
49 std::string id_;
51 // The index of the view being dragged.
52 size_t index_;
54 // The MIME type for the clipboard format for BrowserActionDragData.
55 static const char* kClipboardFormatString;
57 DISALLOW_COPY_AND_ASSIGN(BrowserActionDragData);
60 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_BROWSER_ACTION_DRAG_DATA_H_