| OLD | NEW |
| 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_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // An interface that controls a RenderViewContextMenu instance from observers. | 49 // An interface that controls a RenderViewContextMenu instance from observers. |
| 50 // This interface is designed mainly for controlling the instance while showing | 50 // This interface is designed mainly for controlling the instance while showing |
| 51 // so we can add a context-menu item that takes long time to create its text, | 51 // so we can add a context-menu item that takes long time to create its text, |
| 52 // such as retrieving the item text from a server. The simplest usage is: | 52 // such as retrieving the item text from a server. The simplest usage is: |
| 53 // 1. Adding an item with temporary text; | 53 // 1. Adding an item with temporary text; |
| 54 // 2. Posting a background task that creates the item text, and; | 54 // 2. Posting a background task that creates the item text, and; |
| 55 // 3. Calling UpdateMenuItem() in the callback function. | 55 // 3. Calling UpdateMenuItem() in the callback function. |
| 56 // The following snippet describes the simple usage that updates a context-menu | 56 // The following snippet describes the simple usage that updates a context-menu |
| 57 // item with this interface. | 57 // item with this interface. |
| 58 // | 58 // |
| 59 // class MyTask : public content::URLFetcherDelegate { | 59 // class MyTask : public net::URLFetcherDelegate { |
| 60 // public: | 60 // public: |
| 61 // MyTask(RenderViewContextMenuProxy* proxy, int id) | 61 // MyTask(RenderViewContextMenuProxy* proxy, int id) |
| 62 // : proxy_(proxy), | 62 // : proxy_(proxy), |
| 63 // id_(id) { | 63 // id_(id) { |
| 64 // } | 64 // } |
| 65 // virtual ~MyTask() { | 65 // virtual ~MyTask() { |
| 66 // } | 66 // } |
| 67 // virtual void OnURLFetchComplete(const net::URLFetcher* source, | 67 // virtual void OnURLFetchComplete(const net::URLFetcher* source, |
| 68 // const GURL& url, | 68 // const GURL& url, |
| 69 // const net::URLRequestStatus& status, | 69 // const net::URLRequestStatus& status, |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 // An observer that disables menu items when print preview is active. | 297 // An observer that disables menu items when print preview is active. |
| 298 scoped_ptr<PrintPreviewContextMenuObserver> print_preview_menu_observer_; | 298 scoped_ptr<PrintPreviewContextMenuObserver> print_preview_menu_observer_; |
| 299 | 299 |
| 300 // Our observers. | 300 // Our observers. |
| 301 mutable ObserverList<RenderViewContextMenuObserver> observers_; | 301 mutable ObserverList<RenderViewContextMenuObserver> observers_; |
| 302 | 302 |
| 303 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); | 303 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); |
| 304 }; | 304 }; |
| 305 | 305 |
| 306 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 306 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ |
| OLD | NEW |