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 12 matching lines...) Expand all Loading... |
23 #include "views/painter.h" | 23 #include "views/painter.h" |
24 | 24 |
25 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
26 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" | 26 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" |
27 #else | 27 #else |
28 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" | 28 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" |
29 #endif | 29 #endif |
30 | 30 |
31 class BubblePositioner; | 31 class BubblePositioner; |
32 class CommandUpdater; | 32 class CommandUpdater; |
33 class ExtensionAction2; | 33 class ExtensionAction; |
34 class GURL; | 34 class GURL; |
35 class Profile; | 35 class Profile; |
36 | 36 |
37 ///////////////////////////////////////////////////////////////////////////// | 37 ///////////////////////////////////////////////////////////////////////////// |
38 // | 38 // |
39 // LocationBarView class | 39 // LocationBarView class |
40 // | 40 // |
41 // The LocationBarView class is a View subclass that paints the background | 41 // The LocationBarView class is a View subclass that paints the background |
42 // of the URL bar strip and contains its content. | 42 // of the URL bar strip and contains its content. |
43 // | 43 // |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 DISALLOW_COPY_AND_ASSIGN(SecurityImageView); | 342 DISALLOW_COPY_AND_ASSIGN(SecurityImageView); |
343 }; | 343 }; |
344 | 344 |
345 // PageActionImageView is used to display the icon for a given PageAction | 345 // PageActionImageView is used to display the icon for a given PageAction |
346 // and notify the extension when the icon is clicked. | 346 // and notify the extension when the icon is clicked. |
347 class PageActionImageView : public LocationBarImageView, | 347 class PageActionImageView : public LocationBarImageView, |
348 public ImageLoadingTracker::Observer { | 348 public ImageLoadingTracker::Observer { |
349 public: | 349 public: |
350 PageActionImageView(LocationBarView* owner, | 350 PageActionImageView(LocationBarView* owner, |
351 Profile* profile, | 351 Profile* profile, |
352 ExtensionAction2* page_action, | 352 ExtensionAction* page_action, |
353 const BubblePositioner* bubble_positioner); | 353 const BubblePositioner* bubble_positioner); |
354 virtual ~PageActionImageView(); | 354 virtual ~PageActionImageView(); |
355 | 355 |
356 ExtensionAction2* page_action() { return page_action_; } | 356 ExtensionAction* page_action() { return page_action_; } |
357 | 357 |
358 int current_tab_id() { return current_tab_id_; } | 358 int current_tab_id() { return current_tab_id_; } |
359 | 359 |
360 // Overridden from view for the mouse hovering. | 360 // Overridden from view for the mouse hovering. |
361 virtual bool OnMousePressed(const views::MouseEvent& event); | 361 virtual bool OnMousePressed(const views::MouseEvent& event); |
362 | 362 |
363 // Overridden from LocationBarImageView. | 363 // Overridden from LocationBarImageView. |
364 virtual void ShowInfoBubble(); | 364 virtual void ShowInfoBubble(); |
365 | 365 |
366 // Overridden from ImageLoadingTracker. | 366 // Overridden from ImageLoadingTracker. |
367 virtual void OnImageLoaded(SkBitmap* image, size_t index); | 367 virtual void OnImageLoaded(SkBitmap* image, size_t index); |
368 | 368 |
369 // Called to notify the PageAction that it should determine whether to be | 369 // Called to notify the PageAction that it should determine whether to be |
370 // visible or hidden. |contents| is the TabContents that is active, |url| | 370 // visible or hidden. |contents| is the TabContents that is active, |url| |
371 // is the current page URL. | 371 // is the current page URL. |
372 void UpdateVisibility(TabContents* contents, const GURL& url); | 372 void UpdateVisibility(TabContents* contents, const GURL& url); |
373 | 373 |
374 private: | 374 private: |
375 // The location bar view that owns us. | 375 // The location bar view that owns us. |
376 LocationBarView* owner_; | 376 LocationBarView* owner_; |
377 | 377 |
378 // The current profile (not owned by us). | 378 // The current profile (not owned by us). |
379 Profile* profile_; | 379 Profile* profile_; |
380 | 380 |
381 // The PageAction that this view represents. The PageAction is not owned by | 381 // The PageAction that this view represents. The PageAction is not owned by |
382 // us, it resides in the extension of this particular profile. | 382 // us, it resides in the extension of this particular profile. |
383 ExtensionAction2* page_action_; | 383 ExtensionAction* page_action_; |
384 | 384 |
385 // A cache of bitmaps the page actions might need to show, mapped by path. | 385 // A cache of bitmaps the page actions might need to show, mapped by path. |
386 typedef std::map<std::string, SkBitmap> PageActionMap; | 386 typedef std::map<std::string, SkBitmap> PageActionMap; |
387 PageActionMap page_action_icons_; | 387 PageActionMap page_action_icons_; |
388 | 388 |
389 // The object that is waiting for the image loading to complete | 389 // The object that is waiting for the image loading to complete |
390 // asynchronously. | 390 // asynchronously. |
391 ImageLoadingTracker* tracker_; | 391 ImageLoadingTracker* tracker_; |
392 | 392 |
393 // The tab id we are currently showing the icon for. | 393 // The tab id we are currently showing the icon for. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 // The positioner that places the omnibox and info bubbles. | 538 // The positioner that places the omnibox and info bubbles. |
539 const BubblePositioner* bubble_positioner_; | 539 const BubblePositioner* bubble_positioner_; |
540 | 540 |
541 // Storage of string needed for accessibility. | 541 // Storage of string needed for accessibility. |
542 std::wstring accessible_name_; | 542 std::wstring accessible_name_; |
543 | 543 |
544 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 544 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
545 }; | 545 }; |
546 | 546 |
547 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 547 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ |
OLD | NEW |