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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 DISALLOW_COPY_AND_ASSIGN(SecurityImageView); | 340 DISALLOW_COPY_AND_ASSIGN(SecurityImageView); |
341 }; | 341 }; |
342 | 342 |
343 // PageActionImageView is used to display the icon for a given PageAction | 343 // PageActionImageView is used to display the icon for a given PageAction |
344 // and notify the extension when the icon is clicked. | 344 // and notify the extension when the icon is clicked. |
345 class PageActionImageView : public LocationBarImageView, | 345 class PageActionImageView : public LocationBarImageView, |
346 public ImageLoadingTracker::Observer { | 346 public ImageLoadingTracker::Observer { |
347 public: | 347 public: |
348 PageActionImageView(LocationBarView* owner, | 348 PageActionImageView(LocationBarView* owner, |
349 Profile* profile, | 349 Profile* profile, |
350 const PageAction* page_action, | 350 const ContextualAction* page_action, |
351 const BubblePositioner* bubble_positioner); | 351 const BubblePositioner* bubble_positioner); |
352 virtual ~PageActionImageView(); | 352 virtual ~PageActionImageView(); |
353 | 353 |
354 // Overridden from view for the mouse hovering. | 354 // Overridden from view for the mouse hovering. |
355 virtual bool OnMousePressed(const views::MouseEvent& event); | 355 virtual bool OnMousePressed(const views::MouseEvent& event); |
356 | 356 |
357 // Overridden from LocationBarImageView. | 357 // Overridden from LocationBarImageView. |
358 virtual void ShowInfoBubble(); | 358 virtual void ShowInfoBubble(); |
359 | 359 |
360 // Overridden from ImageLoadingTracker. | 360 // Overridden from ImageLoadingTracker. |
361 virtual void OnImageLoaded(SkBitmap* image, size_t index); | 361 virtual void OnImageLoaded(SkBitmap* image, size_t index); |
362 | 362 |
363 // Called to notify the PageAction that it should determine whether to be | 363 // Called to notify the PageAction that it should determine whether to be |
364 // visible or hidden. |contents| is the TabContents that is active, |url| | 364 // visible or hidden. |contents| is the TabContents that is active, |url| |
365 // is the current page URL. | 365 // is the current page URL. |
366 void UpdateVisibility(TabContents* contents, GURL url); | 366 void UpdateVisibility(TabContents* contents, GURL url); |
367 | 367 |
368 private: | 368 private: |
369 // The location bar view that owns us. | 369 // The location bar view that owns us. |
370 LocationBarView* owner_; | 370 LocationBarView* owner_; |
371 | 371 |
372 // The current profile (not owned by us). | 372 // The current profile (not owned by us). |
373 Profile* profile_; | 373 Profile* profile_; |
374 | 374 |
375 // The PageAction that this view represents. The PageAction is not owned by | 375 // The PageAction that this view represents. The PageAction is not owned by |
376 // us, it resides in the extension of this particular profile. | 376 // us, it resides in the extension of this particular profile. |
377 const PageAction* page_action_; | 377 const ContextualAction* page_action_; |
378 | 378 |
379 // The icons representing different states for the page action. | 379 // The icons representing different states for the page action. |
380 std::vector<SkBitmap> page_action_icons_; | 380 std::vector<SkBitmap> page_action_icons_; |
381 | 381 |
382 // The object that is waiting for the image loading to complete | 382 // The object that is waiting for the image loading to complete |
383 // asynchronously. | 383 // asynchronously. |
384 ImageLoadingTracker* tracker_; | 384 ImageLoadingTracker* tracker_; |
385 | 385 |
386 // The tab id we are currently showing the icon for. | 386 // The tab id we are currently showing the icon for. |
387 int current_tab_id_; | 387 int current_tab_id_; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 // The positioner that places the omnibox and info bubbles. | 528 // The positioner that places the omnibox and info bubbles. |
529 const BubblePositioner* bubble_positioner_; | 529 const BubblePositioner* bubble_positioner_; |
530 | 530 |
531 // Storage of string needed for accessibility. | 531 // Storage of string needed for accessibility. |
532 std::wstring accessible_name_; | 532 std::wstring accessible_name_; |
533 | 533 |
534 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 534 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
535 }; | 535 }; |
536 | 536 |
537 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 537 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ |
OLD | NEW |