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

Side by Side Diff: chrome/browser/views/frame/browser_view.h

Issue 3105004: Adds support for showing the match preview on views. It's behind the (Closed)
Patch Set: Addressed review comments Created 10 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
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.cc ('k') | chrome/browser/views/frame/browser_view.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_FRAME_BROWSER_VIEW_H_ 5 #ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_
6 #define CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ 6 #define CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "app/menus/simple_menu_model.h" 14 #include "app/menus/simple_menu_model.h"
15 #include "base/scoped_ptr.h" 15 #include "base/scoped_ptr.h"
16 #include "base/timer.h" 16 #include "base/timer.h"
17 #include "build/build_config.h" 17 #include "build/build_config.h"
18 #include "chrome/browser/browser.h" 18 #include "chrome/browser/browser.h"
19 #include "chrome/browser/browser_window.h" 19 #include "chrome/browser/browser_window.h"
20 #include "chrome/browser/tabs/tab_strip_model.h" 20 #include "chrome/browser/tabs/tab_strip_model.h"
21 #include "chrome/browser/views/frame/browser_bubble_host.h" 21 #include "chrome/browser/views/frame/browser_bubble_host.h"
22 #include "chrome/browser/views/frame/browser_frame.h" 22 #include "chrome/browser/views/frame/browser_frame.h"
23 #include "chrome/browser/views/infobars/infobar_container.h" 23 #include "chrome/browser/views/infobars/infobar_container.h"
24 #include "chrome/browser/views/tabs/tab_strip.h" 24 #include "chrome/browser/views/tabs/tab_strip.h"
25 #include "chrome/browser/views/tabs/base_tab_strip.h" 25 #include "chrome/browser/views/tabs/base_tab_strip.h"
26 #include "chrome/browser/views/unhandled_keyboard_event_handler.h" 26 #include "chrome/browser/views/unhandled_keyboard_event_handler.h"
27 #include "chrome/common/notification_registrar.h"
27 #include "gfx/native_widget_types.h" 28 #include "gfx/native_widget_types.h"
28 #include "views/window/client_view.h" 29 #include "views/window/client_view.h"
29 #include "views/window/window_delegate.h" 30 #include "views/window/window_delegate.h"
30 31
31 #if defined(OS_WIN) 32 #if defined(OS_WIN)
32 #include "chrome/browser/hang_monitor/hung_plugin_action.h" 33 #include "chrome/browser/hang_monitor/hung_plugin_action.h"
33 #include "chrome/browser/hang_monitor/hung_window_detector.h" 34 #include "chrome/browser/hang_monitor/hung_window_detector.h"
34 #include "views/controls/menu/native_menu_win.h" 35 #include "views/controls/menu/native_menu_win.h"
35 #endif 36 #endif
36 37
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 const NotificationSource& source, 329 const NotificationSource& source,
329 const NotificationDetails& details); 330 const NotificationDetails& details);
330 331
331 // Overridden from TabStripModelObserver: 332 // Overridden from TabStripModelObserver:
332 virtual void TabDetachedAt(TabContents* contents, int index); 333 virtual void TabDetachedAt(TabContents* contents, int index);
333 virtual void TabDeselectedAt(TabContents* contents, int index); 334 virtual void TabDeselectedAt(TabContents* contents, int index);
334 virtual void TabSelectedAt(TabContents* old_contents, 335 virtual void TabSelectedAt(TabContents* old_contents,
335 TabContents* new_contents, 336 TabContents* new_contents,
336 int index, 337 int index,
337 bool user_gesture); 338 bool user_gesture);
339 virtual void TabReplacedAt(TabContents* old_contents,
340 TabContents* new_contents,
341 int index,
342 TabStripModelObserver::TabReplaceType type);
338 virtual void TabStripEmpty(); 343 virtual void TabStripEmpty();
339 344
340 // Overridden from menus::SimpleMenuModel::Delegate: 345 // Overridden from menus::SimpleMenuModel::Delegate:
341 virtual bool IsCommandIdChecked(int command_id) const; 346 virtual bool IsCommandIdChecked(int command_id) const;
342 virtual bool IsCommandIdEnabled(int command_id) const; 347 virtual bool IsCommandIdEnabled(int command_id) const;
343 virtual bool GetAcceleratorForCommandId(int command_id, 348 virtual bool GetAcceleratorForCommandId(int command_id,
344 menus::Accelerator* accelerator); 349 menus::Accelerator* accelerator);
345 virtual bool IsLabelForCommandIdDynamic(int command_id) const; 350 virtual bool IsLabelForCommandIdDynamic(int command_id) const;
346 virtual string16 GetLabelForCommandId(int command_id) const; 351 virtual string16 GetLabelForCommandId(int command_id) const;
347 virtual void ExecuteCommand(int command_id); 352 virtual void ExecuteCommand(int command_id);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 // multiple times over the life of the browser, and is run when the display 410 // multiple times over the life of the browser, and is run when the display
406 // mode for the tabstrip changes from horizontal to vertical. 411 // mode for the tabstrip changes from horizontal to vertical.
407 virtual void InitTabStrip(TabStripModel* tab_strip_model); 412 virtual void InitTabStrip(TabStripModel* tab_strip_model);
408 413
409 // Browser window related initializations. 414 // Browser window related initializations.
410 virtual void Init(); 415 virtual void Init();
411 416
412 private: 417 private:
413 friend class BrowserViewLayout; 418 friend class BrowserViewLayout;
414 419
420 class ContentsContainer;
421
415 #if defined(OS_WIN) 422 #if defined(OS_WIN)
416 // Creates the system menu. 423 // Creates the system menu.
417 void InitSystemMenu(); 424 void InitSystemMenu();
418 #endif 425 #endif
419 426
420 // Returns the BrowserViewLayout. 427 // Returns the BrowserViewLayout.
421 BrowserViewLayout* GetBrowserViewLayout() const; 428 BrowserViewLayout* GetBrowserViewLayout() const;
422 429
423 // Layout the Status Bubble. 430 // Layout the Status Bubble.
424 void LayoutStatusBubble(int top); 431 void LayoutStatusBubble(int top);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 477
471 // Retrieves the command id for the specified Windows app command. 478 // Retrieves the command id for the specified Windows app command.
472 int GetCommandIDForAppCommandID(int app_command_id) const; 479 int GetCommandIDForAppCommandID(int app_command_id) const;
473 480
474 // Callback for the loading animation(s) associated with this view. 481 // Callback for the loading animation(s) associated with this view.
475 void LoadingAnimationCallback(); 482 void LoadingAnimationCallback();
476 483
477 // Initialize the hung plugin detector. 484 // Initialize the hung plugin detector.
478 void InitHangMonitor(); 485 void InitHangMonitor();
479 486
480 // Initialize class statics. 487 // Shows the match preview for the selected tab contents.
481 static void InitClass(); 488 void ShowMatchPreview();
489
490 // Hides the match preview for the selected tab contents.
491 void HideMatchPreview();
492
493 // Invoked from TabSelectedAt or when the match preview is made active. Is
494 // |change_tab_contents| is true, |new_contents| is added to the view
495 // hierarchy, if |change_tab_contents| is false, it's assumed |new_contents|
496 // has already been added to the view hierarchy.
497 void ProcessTabSelected(TabContents* new_contents, bool change_tab_contents);
482 498
483 // Last focused view that issued a tab traversal. 499 // Last focused view that issued a tab traversal.
484 int last_focused_view_storage_id_; 500 int last_focused_view_storage_id_;
485 501
486 // The BrowserFrame that hosts this view. 502 // The BrowserFrame that hosts this view.
487 BrowserFrame* frame_; 503 BrowserFrame* frame_;
488 504
489 // The Browser object we are associated with. 505 // The Browser object we are associated with.
490 scoped_ptr<Browser> browser_; 506 scoped_ptr<Browser> browser_;
491 507
(...skipping 16 matching lines...) Expand all
508 524
509 // The InfoBarContainer that contains InfoBars for the current tab. 525 // The InfoBarContainer that contains InfoBars for the current tab.
510 InfoBarContainer* infobar_container_; 526 InfoBarContainer* infobar_container_;
511 527
512 // The view that contains the selected TabContents. 528 // The view that contains the selected TabContents.
513 TabContentsContainer* contents_container_; 529 TabContentsContainer* contents_container_;
514 530
515 // The view that contains devtools window for the selected TabContents. 531 // The view that contains devtools window for the selected TabContents.
516 TabContentsContainer* devtools_container_; 532 TabContentsContainer* devtools_container_;
517 533
534 // The view that contains the match preview TabContents.
535 TabContentsContainer* preview_container_;
536
537 // The view managing both the contents_container_ and preview_container_.
538 ContentsContainer* contents_;
539
518 // Split view containing the contents container and devtools container. 540 // Split view containing the contents container and devtools container.
519 views::SingleSplitView* contents_split_; 541 views::SingleSplitView* contents_split_;
520 542
521 // Tracks and stores the last focused view which is not the 543 // Tracks and stores the last focused view which is not the
522 // devtools_container_ or any of its children. Used to restore focus once 544 // devtools_container_ or any of its children. Used to restore focus once
523 // the devtools_container_ is hidden. 545 // the devtools_container_ is hidden.
524 scoped_ptr<views::ExternalFocusTracker> devtools_focus_tracker_; 546 scoped_ptr<views::ExternalFocusTracker> devtools_focus_tracker_;
525 547
526 // The Status information bubble that appears at the bottom of the window. 548 // The Status information bubble that appears at the bottom of the window.
527 scoped_ptr<StatusBubbleViews> status_bubble_; 549 scoped_ptr<StatusBubbleViews> status_bubble_;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 // The timer used to update frames for the Loading Animation. 591 // The timer used to update frames for the Loading Animation.
570 base::RepeatingTimer<BrowserView> loading_animation_timer_; 592 base::RepeatingTimer<BrowserView> loading_animation_timer_;
571 593
572 // A bottom bar for showing extensions. 594 // A bottom bar for showing extensions.
573 ExtensionShelf* extension_shelf_; 595 ExtensionShelf* extension_shelf_;
574 596
575 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; 597 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_;
576 598
577 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; 599 scoped_ptr<AccessibleViewHelper> accessible_view_helper_;
578 600
601 NotificationRegistrar registrar_;
602
579 DISALLOW_COPY_AND_ASSIGN(BrowserView); 603 DISALLOW_COPY_AND_ASSIGN(BrowserView);
580 }; 604 };
581 605
582 #endif // CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ 606 #endif // CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.cc ('k') | chrome/browser/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698