| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_VIEWS_LOCATION_BAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 virtual void SaveStateToContents(TabContents* contents); | 151 virtual void SaveStateToContents(TabContents* contents); |
| 152 virtual void Revert(); | 152 virtual void Revert(); |
| 153 virtual AutocompleteEditView* location_entry() { | 153 virtual AutocompleteEditView* location_entry() { |
| 154 return location_entry_.get(); | 154 return location_entry_.get(); |
| 155 } | 155 } |
| 156 virtual LocationBarTesting* GetLocationBarForTesting() { return this; } | 156 virtual LocationBarTesting* GetLocationBarForTesting() { return this; } |
| 157 | 157 |
| 158 // Overridden from LocationBarTesting: | 158 // Overridden from LocationBarTesting: |
| 159 virtual int PageActionCount() { return page_action_views_.size(); } | 159 virtual int PageActionCount() { return page_action_views_.size(); } |
| 160 virtual int PageActionVisibleCount(); | 160 virtual int PageActionVisibleCount(); |
| 161 virtual ExtensionAction* GetPageAction(size_t index); |
| 162 virtual ExtensionAction* GetVisiblePageAction(size_t index); |
| 163 virtual void TestPageActionPressed(size_t index); |
| 161 | 164 |
| 162 static const int kVertMargin; | 165 static const int kVertMargin; |
| 163 | 166 |
| 164 protected: | 167 protected: |
| 165 void Focus(); | 168 void Focus(); |
| 166 | 169 |
| 167 private: | 170 private: |
| 168 // View used when the user has selected a keyword. | 171 // View used when the user has selected a keyword. |
| 169 // | 172 // |
| 170 // SelectedKeywordView maintains two labels. One label contains the | 173 // SelectedKeywordView maintains two labels. One label contains the |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 PageActionImageView(LocationBarView* owner, | 353 PageActionImageView(LocationBarView* owner, |
| 351 Profile* profile, | 354 Profile* profile, |
| 352 ExtensionAction* page_action, | 355 ExtensionAction* page_action, |
| 353 const BubblePositioner* bubble_positioner); | 356 const BubblePositioner* bubble_positioner); |
| 354 virtual ~PageActionImageView(); | 357 virtual ~PageActionImageView(); |
| 355 | 358 |
| 356 ExtensionAction* page_action() { return page_action_; } | 359 ExtensionAction* page_action() { return page_action_; } |
| 357 | 360 |
| 358 int current_tab_id() { return current_tab_id_; } | 361 int current_tab_id() { return current_tab_id_; } |
| 359 | 362 |
| 360 // Overridden from view for the mouse hovering. | 363 // Overridden from view. |
| 364 virtual void OnMouseMoved(const views::MouseEvent& event); |
| 361 virtual bool OnMousePressed(const views::MouseEvent& event); | 365 virtual bool OnMousePressed(const views::MouseEvent& event); |
| 362 | 366 |
| 363 // Overridden from LocationBarImageView. | 367 // Overridden from LocationBarImageView. |
| 364 virtual void ShowInfoBubble(); | 368 virtual void ShowInfoBubble(); |
| 365 | 369 |
| 366 // Overridden from ImageLoadingTracker. | 370 // Overridden from ImageLoadingTracker. |
| 367 virtual void OnImageLoaded(SkBitmap* image, size_t index); | 371 virtual void OnImageLoaded(SkBitmap* image, size_t index); |
| 368 | 372 |
| 369 // Called to notify the PageAction that it should determine whether to be | 373 // Called to notify the PageAction that it should determine whether to be |
| 370 // visible or hidden. |contents| is the TabContents that is active, |url| | 374 // visible or hidden. |contents| is the TabContents that is active, |url| |
| 371 // is the current page URL. | 375 // is the current page URL. |
| 372 void UpdateVisibility(TabContents* contents, const GURL& url); | 376 void UpdateVisibility(TabContents* contents, const GURL& url); |
| 373 | 377 |
| 378 // Either notify listners or show a popup depending on the page action. |
| 379 void ExecuteAction(int button); |
| 380 |
| 374 private: | 381 private: |
| 375 // The location bar view that owns us. | 382 // The location bar view that owns us. |
| 376 LocationBarView* owner_; | 383 LocationBarView* owner_; |
| 377 | 384 |
| 378 // The current profile (not owned by us). | 385 // The current profile (not owned by us). |
| 379 Profile* profile_; | 386 Profile* profile_; |
| 380 | 387 |
| 381 // The PageAction that this view represents. The PageAction is not owned by | 388 // The PageAction that this view represents. The PageAction is not owned by |
| 382 // us, it resides in the extension of this particular profile. | 389 // us, it resides in the extension of this particular profile. |
| 383 ExtensionAction* page_action_; | 390 ExtensionAction* page_action_; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 // The positioner that places the omnibox and info bubbles. | 545 // The positioner that places the omnibox and info bubbles. |
| 539 const BubblePositioner* bubble_positioner_; | 546 const BubblePositioner* bubble_positioner_; |
| 540 | 547 |
| 541 // Storage of string needed for accessibility. | 548 // Storage of string needed for accessibility. |
| 542 std::wstring accessible_name_; | 549 std::wstring accessible_name_; |
| 543 | 550 |
| 544 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 551 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
| 545 }; | 552 }; |
| 546 | 553 |
| 547 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 554 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |