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

Side by Side Diff: chrome/browser/views/location_bar_view.h

Issue 165272: Add a first attempt at a compact location bar and a status bar. The status ba... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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
« no previous file with comments | « chrome/browser/views/frame/status_area_view.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 Profile* profile_; 231 Profile* profile_;
232 232
233 DISALLOW_COPY_AND_ASSIGN(KeywordHintView); 233 DISALLOW_COPY_AND_ASSIGN(KeywordHintView);
234 }; 234 };
235 235
236 236
237 class ShowInfoBubbleTask; 237 class ShowInfoBubbleTask;
238 class ShowFirstRunBubbleTask; 238 class ShowFirstRunBubbleTask;
239 239
240 class LocationBarImageView : public views::ImageView, 240 class LocationBarImageView : public views::ImageView,
241 public InfoBubbleDelegate { 241 public InfoBubbleDelegate {
242 public: 242 public:
243 LocationBarImageView(); 243 LocationBarImageView();
244 virtual ~LocationBarImageView(); 244 virtual ~LocationBarImageView();
245 245
246 // Overridden from view for the mouse hovering. 246 // Overridden from view for the mouse hovering.
247 virtual void OnMouseMoved(const views::MouseEvent& event); 247 virtual void OnMouseMoved(const views::MouseEvent& event);
248 virtual void OnMouseExited(const views::MouseEvent& event); 248 virtual void OnMouseExited(const views::MouseEvent& event);
249 virtual bool OnMousePressed(const views::MouseEvent& event) = 0; 249 virtual bool OnMousePressed(const views::MouseEvent& event) = 0;
250 250
251 // InfoBubbleDelegate 251 // InfoBubbleDelegate
252 void InfoBubbleClosing(InfoBubble* info_bubble, bool closed_by_escape); 252 void InfoBubbleClosing(InfoBubble* info_bubble, bool closed_by_escape);
253 bool CloseOnEscape() { return true; } 253 bool CloseOnEscape() { return true; }
254 254
255 virtual void ShowInfoBubble() = 0; 255 virtual void ShowInfoBubble() = 0;
256 256
257 protected: 257 protected:
258 void ShowInfoBubbleImpl(const std::wstring& text, SkColor text_color); 258 void ShowInfoBubbleImpl(const std::wstring& text, SkColor text_color);
259 259
260 private: 260 private:
261 friend class ShowInfoBubbleTask; 261 friend class ShowInfoBubbleTask;
262 262
263 // The currently shown info bubble if any. 263 // The currently shown info bubble if any.
264 InfoBubble* info_bubble_; 264 InfoBubble* info_bubble_;
265 265
266 // A task used to display the info bubble when the mouse hovers on the 266 // A task used to display the info bubble when the mouse hovers on the
267 // image. 267 // image.
268 ShowInfoBubbleTask* show_info_bubble_task_; 268 ShowInfoBubbleTask* show_info_bubble_task_;
269 269
270 DISALLOW_COPY_AND_ASSIGN(LocationBarImageView); 270 DISALLOW_COPY_AND_ASSIGN(LocationBarImageView);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 Profile* profile_; 312 Profile* profile_;
313 313
314 ToolbarModel* model_; 314 ToolbarModel* model_;
315 315
316 DISALLOW_COPY_AND_ASSIGN(SecurityImageView); 316 DISALLOW_COPY_AND_ASSIGN(SecurityImageView);
317 }; 317 };
318 318
319 // PageActionImageView is used to display the icon for a given PageAction 319 // PageActionImageView is used to display the icon for a given PageAction
320 // and notify the extension when the icon is clicked. 320 // and notify the extension when the icon is clicked.
321 class PageActionImageView : public LocationBarImageView { 321 class PageActionImageView : public LocationBarImageView {
322 public: 322 public:
323 PageActionImageView( 323 PageActionImageView(
324 LocationBarView* owner, Profile* profile, 324 LocationBarView* owner, Profile* profile,
325 const PageAction* page_action); 325 const PageAction* page_action);
326 virtual ~PageActionImageView(); 326 virtual ~PageActionImageView();
327 327
328 // Overridden from view for the mouse hovering. 328 // Overridden from view for the mouse hovering.
329 virtual bool OnMousePressed(const views::MouseEvent& event); 329 virtual bool OnMousePressed(const views::MouseEvent& event);
330 330
331 // Overridden from LocationBarImageView. 331 // Overridden from LocationBarImageView.
332 virtual void ShowInfoBubble(); 332 virtual void ShowInfoBubble();
333 333
334 // Called to notify the PageAction that it should determine whether to be 334 // Called to notify the PageAction that it should determine whether to be
335 // visible or hidden. |contents| is the TabContents that is active, |url| 335 // visible or hidden. |contents| is the TabContents that is active, |url|
336 // is the current page URL. 336 // is the current page URL.
337 void UpdateVisibility(TabContents* contents, GURL url); 337 void UpdateVisibility(TabContents* contents, GURL url);
338 338
339 // A callback for when the image has loaded. 339 // A callback for when the image has loaded.
340 void OnImageLoaded(SkBitmap* image, size_t index); 340 void OnImageLoaded(SkBitmap* image, size_t index);
341 341
342 private: 342 private:
343 // We load the images for the PageActions on the file thread. These tasks 343 // We load the images for the PageActions on the file thread. These tasks
344 // help with that. 344 // help with that.
345 class LoadImageTask; 345 class LoadImageTask;
346 class ImageLoadingTracker; 346 class ImageLoadingTracker;
347 347
348 // The location bar view that owns us. 348 // The location bar view that owns us.
349 LocationBarView* owner_; 349 LocationBarView* owner_;
350 350
351 // The current profile (not owned by us). 351 // The current profile (not owned by us).
352 Profile* profile_; 352 Profile* profile_;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 bool popup_window_mode_; 506 bool popup_window_mode_;
507 507
508 // Used schedule a task for the first run info bubble. 508 // Used schedule a task for the first run info bubble.
509 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; 509 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_;
510 510
511 // The positioner that places the autocomplete popup. 511 // The positioner that places the autocomplete popup.
512 AutocompletePopupPositioner* popup_positioner_; 512 AutocompletePopupPositioner* popup_positioner_;
513 }; 513 };
514 514
515 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ 515 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/views/frame/status_area_view.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698