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

Side by Side Diff: chrome/browser/ui/views/location_bar/page_action_image_view.h

Issue 9402018: Experimental Extension Keybinding (first cut). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 11
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 virtual void InspectPopup(ExtensionAction* action) OVERRIDE; 61 virtual void InspectPopup(ExtensionAction* action) OVERRIDE;
62 62
63 // Overridden from views::Widget::Observer 63 // Overridden from views::Widget::Observer
64 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; 64 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
65 65
66 // content::NotificationObserver implementation. 66 // content::NotificationObserver implementation.
67 virtual void Observe(int type, 67 virtual void Observe(int type,
68 const content::NotificationSource& source, 68 const content::NotificationSource& source,
69 const content::NotificationDetails& details) OVERRIDE; 69 const content::NotificationDetails& details) OVERRIDE;
70 70
71 // Overridden from ui::AcceleratorTarget.
72 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
73 virtual bool CanHandleAccelerators() const OVERRIDE;
74
71 // Called to notify the PageAction that it should determine whether to be 75 // Called to notify the PageAction that it should determine whether to be
72 // visible or hidden. |contents| is the TabContents that is active, |url| is 76 // visible or hidden. |contents| is the TabContents that is active, |url| is
73 // the current page URL. 77 // the current page URL.
74 void UpdateVisibility(content::WebContents* contents, const GURL& url); 78 void UpdateVisibility(content::WebContents* contents, const GURL& url);
75 79
76 // Either notify listeners or show a popup depending on the page action. 80 // Either notify listeners or show a popup depending on the page action.
77 void ExecuteAction(int button, bool inspect_with_devtools); 81 void ExecuteAction(int button, bool inspect_with_devtools);
78 82
79 private: 83 private:
80 // Hides the active popup, if there is one. 84 // Hides the active popup, if there is one.
(...skipping 25 matching lines...) Expand all
106 110
107 // This is used for post-install visual feedback. The page_action icon is 111 // This is used for post-install visual feedback. The page_action icon is
108 // briefly shown even if it hasn't been enabled by its extension. 112 // briefly shown even if it hasn't been enabled by its extension.
109 bool preview_enabled_; 113 bool preview_enabled_;
110 114
111 // The current popup and the button it came from. NULL if no popup. 115 // The current popup and the button it came from. NULL if no popup.
112 ExtensionPopup* popup_; 116 ExtensionPopup* popup_;
113 117
114 content::NotificationRegistrar registrar_; 118 content::NotificationRegistrar registrar_;
115 119
120 // The extension keybinding accelerator this page action is listening for (to
121 // show the popup).
122 scoped_ptr<ui::Accelerator> keybinding_;
123
116 scoped_ptr<views::MenuRunner> menu_runner_; 124 scoped_ptr<views::MenuRunner> menu_runner_;
117 125
118 DISALLOW_IMPLICIT_CONSTRUCTORS(PageActionImageView); 126 DISALLOW_IMPLICIT_CONSTRUCTORS(PageActionImageView);
119 }; 127 };
120 128
121 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ 129 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/location_bar/page_action_image_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698