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

Side by Side Diff: chrome/browser/extensions/extension_tabs_module.h

Issue 9225010: Fix callback for chrome.tabs.update with javascript URLs. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: NULL out web_contents_ if destroyed Created 8 years, 10 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 (c) 2011 The Chromium Authors. All rights reserved. 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 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_EXTENSION_TABS_MODULE_H__ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "chrome/browser/extensions/extension_function.h" 13 #include "chrome/browser/extensions/extension_function.h"
14 #include "content/public/browser/notification_observer.h" 14 #include "content/public/browser/notification_observer.h"
15 #include "content/public/browser/notification_registrar.h" 15 #include "content/public/browser/notification_registrar.h"
16 #include "content/public/browser/web_contents_observer.h" 16 #include "content/public/browser/web_contents_observer.h"
17 #include "googleurl/src/gurl.h" 17 #include "googleurl/src/gurl.h"
18 18
19 class BackingStore; 19 class BackingStore;
20 class SkBitmap; 20 class SkBitmap;
21 21 class TabStripModel;
Mihai Parparita -not on Chrome 2012/01/30 16:33:00 Nit: This can be removed now.
jstritar 2012/01/30 16:40:23 Done.
22 namespace base { 22 namespace base {
23 class DictionaryValue; 23 class DictionaryValue;
24 } // namespace base 24 } // namespace base
25 25 namespace content {
26 class WebContents;
27 } // namespace content
26 // Windows 28 // Windows
27 class GetWindowFunction : public SyncExtensionFunction { 29 class GetWindowFunction : public SyncExtensionFunction {
28 virtual ~GetWindowFunction() {} 30 virtual ~GetWindowFunction() {}
29 virtual bool RunImpl() OVERRIDE; 31 virtual bool RunImpl() OVERRIDE;
30 DECLARE_EXTENSION_FUNCTION_NAME("windows.get") 32 DECLARE_EXTENSION_FUNCTION_NAME("windows.get")
31 }; 33 };
32 class GetCurrentWindowFunction : public SyncExtensionFunction { 34 class GetCurrentWindowFunction : public SyncExtensionFunction {
33 virtual ~GetCurrentWindowFunction() {} 35 virtual ~GetCurrentWindowFunction() {}
34 virtual bool RunImpl() OVERRIDE; 36 virtual bool RunImpl() OVERRIDE;
35 DECLARE_EXTENSION_FUNCTION_NAME("windows.getCurrent") 37 DECLARE_EXTENSION_FUNCTION_NAME("windows.getCurrent")
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 virtual bool RunImpl() OVERRIDE; 107 virtual bool RunImpl() OVERRIDE;
106 DECLARE_EXTENSION_FUNCTION_NAME("tabs.highlight") 108 DECLARE_EXTENSION_FUNCTION_NAME("tabs.highlight")
107 }; 109 };
108 class UpdateTabFunction : public AsyncExtensionFunction, 110 class UpdateTabFunction : public AsyncExtensionFunction,
109 public content::WebContentsObserver { 111 public content::WebContentsObserver {
110 public: 112 public:
111 UpdateTabFunction(); 113 UpdateTabFunction();
112 private: 114 private:
113 virtual ~UpdateTabFunction() {} 115 virtual ~UpdateTabFunction() {}
114 virtual bool RunImpl() OVERRIDE; 116 virtual bool RunImpl() OVERRIDE;
117 virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE;
115 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 118 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
116 void OnExecuteCodeFinished(int request_id, 119 void OnExecuteCodeFinished(int request_id,
117 bool success, 120 bool success,
118 const std::string& error); 121 const std::string& error);
122 void PopulateResult();
123 content::WebContents* web_contents_;
Mihai Parparita -not on Chrome 2012/01/30 16:33:00 Nit: mind adding an empty line between the methods
jstritar 2012/01/30 16:40:23 Done.
119 DECLARE_EXTENSION_FUNCTION_NAME("tabs.update") 124 DECLARE_EXTENSION_FUNCTION_NAME("tabs.update")
120 }; 125 };
121 class MoveTabsFunction : public SyncExtensionFunction { 126 class MoveTabsFunction : public SyncExtensionFunction {
122 virtual ~MoveTabsFunction() {} 127 virtual ~MoveTabsFunction() {}
123 virtual bool RunImpl() OVERRIDE; 128 virtual bool RunImpl() OVERRIDE;
124 DECLARE_EXTENSION_FUNCTION_NAME("tabs.move") 129 DECLARE_EXTENSION_FUNCTION_NAME("tabs.move")
125 }; 130 };
126 class ReloadTabFunction : public SyncExtensionFunction { 131 class ReloadTabFunction : public SyncExtensionFunction {
127 virtual ~ReloadTabFunction() {} 132 virtual ~ReloadTabFunction() {}
128 virtual bool RunImpl() OVERRIDE; 133 virtual bool RunImpl() OVERRIDE;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl(). 175 // The format (JPEG vs PNG) of the resulting image. Set in RunImpl().
171 ImageFormat image_format_; 176 ImageFormat image_format_;
172 177
173 // Quality setting to use when encoding jpegs. Set in RunImpl(). 178 // Quality setting to use when encoding jpegs. Set in RunImpl().
174 int image_quality_; 179 int image_quality_;
175 180
176 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab") 181 DECLARE_EXTENSION_FUNCTION_NAME("tabs.captureVisibleTab")
177 }; 182 };
178 183
179 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__ 184 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TABS_MODULE_H__
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_javascript_url_apitest.cc ('k') | chrome/browser/extensions/extension_tabs_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698