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

Side by Side Diff: chrome/browser/extensions/api/tabs/tabs_api.h

Issue 2153943002: Implementing TabManager extensions API Discard Function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reset protection time Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/tabs/tabs_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_EXTENSIONS_API_TABS_TABS_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "chrome/browser/extensions/chrome_extension_function.h" 12 #include "chrome/browser/extensions/chrome_extension_function.h"
13 #include "chrome/browser/extensions/chrome_extension_function_details.h" 13 #include "chrome/browser/extensions/chrome_extension_function_details.h"
14 #include "chrome/common/extensions/api/tabs.h" 14 #include "chrome/common/extensions/api/tabs.h"
15 #include "components/zoom/zoom_controller.h" 15 #include "components/zoom/zoom_controller.h"
16 #include "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_observer.h"
17 #include "content/public/browser/notification_registrar.h" 17 #include "content/public/browser/notification_registrar.h"
18 #include "extensions/browser/api/execute_code_function.h" 18 #include "extensions/browser/api/execute_code_function.h"
19 #include "extensions/browser/api/web_contents_capture_client.h" 19 #include "extensions/browser/api/web_contents_capture_client.h"
20 #include "extensions/browser/extension_function.h"
20 #include "extensions/common/extension_resource.h" 21 #include "extensions/common/extension_resource.h"
21 #include "extensions/common/user_script.h" 22 #include "extensions/common/user_script.h"
22 #include "url/gurl.h" 23 #include "url/gurl.h"
23 24
24 class GURL; 25 class GURL;
25 class SkBitmap; 26 class SkBitmap;
26 class TabStripModel; 27 class TabStripModel;
27 28
28 namespace base { 29 namespace base {
29 class DictionaryValue; 30 class DictionaryValue;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 class TabsDuplicateFunction : public ChromeSyncExtensionFunction { 130 class TabsDuplicateFunction : public ChromeSyncExtensionFunction {
130 ~TabsDuplicateFunction() override {} 131 ~TabsDuplicateFunction() override {}
131 bool RunSync() override; 132 bool RunSync() override;
132 DECLARE_EXTENSION_FUNCTION("tabs.duplicate", TABS_DUPLICATE) 133 DECLARE_EXTENSION_FUNCTION("tabs.duplicate", TABS_DUPLICATE)
133 }; 134 };
134 class TabsHighlightFunction : public ChromeSyncExtensionFunction { 135 class TabsHighlightFunction : public ChromeSyncExtensionFunction {
135 ~TabsHighlightFunction() override {} 136 ~TabsHighlightFunction() override {}
136 bool RunSync() override; 137 bool RunSync() override;
137 bool HighlightTab(TabStripModel* tabstrip, 138 bool HighlightTab(TabStripModel* tabstrip,
138 ui::ListSelectionModel* selection, 139 ui::ListSelectionModel* selection,
139 int *active_index, 140 int* active_index,
140 int index); 141 int index);
141 DECLARE_EXTENSION_FUNCTION("tabs.highlight", TABS_HIGHLIGHT) 142 DECLARE_EXTENSION_FUNCTION("tabs.highlight", TABS_HIGHLIGHT)
142 }; 143 };
143 class TabsUpdateFunction : public ChromeAsyncExtensionFunction { 144 class TabsUpdateFunction : public ChromeAsyncExtensionFunction {
144 public: 145 public:
145 TabsUpdateFunction(); 146 TabsUpdateFunction();
146 147
147 protected: 148 protected:
148 ~TabsUpdateFunction() override {} 149 ~TabsUpdateFunction() override {}
149 virtual bool UpdateURL(const std::string& url, 150 virtual bool UpdateURL(const std::string& url,
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 316
316 class TabsGetZoomSettingsFunction : public ZoomAPIFunction { 317 class TabsGetZoomSettingsFunction : public ZoomAPIFunction {
317 private: 318 private:
318 ~TabsGetZoomSettingsFunction() override {} 319 ~TabsGetZoomSettingsFunction() override {}
319 320
320 bool RunAsync() override; 321 bool RunAsync() override;
321 322
322 DECLARE_EXTENSION_FUNCTION("tabs.getZoomSettings", TABS_GETZOOMSETTINGS) 323 DECLARE_EXTENSION_FUNCTION("tabs.getZoomSettings", TABS_GETZOOMSETTINGS)
323 }; 324 };
324 325
326 class TabsDiscardFunction : public UIThreadExtensionFunction {
327 public:
328 DECLARE_EXTENSION_FUNCTION("tabs.discard", TABS_DISCARD)
329
330 TabsDiscardFunction();
331
332 private:
333 ~TabsDiscardFunction() override;
334
335 // ExtensionFunction:
336 ExtensionFunction::ResponseAction Run() override;
337
338 DISALLOW_COPY_AND_ASSIGN(TabsDiscardFunction);
339 };
340
325 } // namespace extensions 341 } // namespace extensions
326 342
327 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_ 343 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/tabs/tabs_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698