| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_BROWSER_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_H_ |
| 6 #define CHROME_BROWSER_UI_BROWSER_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/instant/instant_controller_delegate.h" | 23 #include "chrome/browser/instant/instant_controller_delegate.h" |
| 24 #include "chrome/browser/intents/device_attached_intent_source.h" | 24 #include "chrome/browser/intents/device_attached_intent_source.h" |
| 25 #include "chrome/browser/prefs/pref_change_registrar.h" | 25 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 26 #include "chrome/browser/prefs/pref_member.h" | 26 #include "chrome/browser/prefs/pref_member.h" |
| 27 #include "chrome/browser/sessions/session_id.h" | 27 #include "chrome/browser/sessions/session_id.h" |
| 28 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" | 28 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" |
| 29 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 29 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
| 30 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" | 30 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" |
| 31 #include "chrome/browser/ui/browser_navigator.h" | 31 #include "chrome/browser/ui/browser_navigator.h" |
| 32 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" | 32 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" |
| 33 #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h" | |
| 34 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" | 33 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" |
| 35 #include "chrome/browser/ui/select_file_dialog.h" | 34 #include "chrome/browser/ui/select_file_dialog.h" |
| 36 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" | 35 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" |
| 37 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" | 36 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" |
| 38 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 37 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 39 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 38 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 40 #include "chrome/browser/ui/zoom/zoom_observer.h" | 39 #include "chrome/browser/ui/zoom/zoom_observer.h" |
| 41 #include "chrome/common/content_settings.h" | 40 #include "chrome/common/content_settings.h" |
| 42 #include "chrome/common/content_settings_types.h" | 41 #include "chrome/common/content_settings_types.h" |
| 43 #include "chrome/common/extensions/extension_constants.h" | 42 #include "chrome/common/extensions/extension_constants.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 // Invoked when the fullscreen state of the window changes. | 354 // Invoked when the fullscreen state of the window changes. |
| 356 // BrowserWindow::EnterFullscreen invokes this after the window has become | 355 // BrowserWindow::EnterFullscreen invokes this after the window has become |
| 357 // fullscreen. | 356 // fullscreen. |
| 358 void WindowFullscreenStateChanged(); | 357 void WindowFullscreenStateChanged(); |
| 359 | 358 |
| 360 // Assorted browser commands //////////////////////////////////////////////// | 359 // Assorted browser commands //////////////////////////////////////////////// |
| 361 | 360 |
| 362 // NOTE: Within each of the following sections, the IDs are ordered roughly by | 361 // NOTE: Within each of the following sections, the IDs are ordered roughly by |
| 363 // how they appear in the GUI/menus (left to right, top to bottom, etc.). | 362 // how they appear in the GUI/menus (left to right, top to bottom, etc.). |
| 364 | 363 |
| 365 // In kiosk mode, the first toggle is valid, the rest is discarded. | |
| 366 void ToggleFullscreenMode(); | |
| 367 // See the description of | 364 // See the description of |
| 368 // FullscreenController::ToggleFullscreenModeWithExtension. | 365 // FullscreenController::ToggleFullscreenModeWithExtension. |
| 369 void ToggleFullscreenModeWithExtension(const GURL& extension_url); | 366 void ToggleFullscreenModeWithExtension(const GURL& extension_url); |
| 370 #if defined(OS_WIN) | 367 #if defined(OS_WIN) |
| 371 // See the description of FullscreenController::ToggleMetroSnapMode. | 368 // See the description of FullscreenController::ToggleMetroSnapMode. |
| 372 void SetMetroSnapMode(bool enable); | 369 void SetMetroSnapMode(bool enable); |
| 373 #endif | 370 #endif |
| 374 #if defined(OS_MACOSX) | 371 #if defined(OS_MACOSX) |
| 375 void TogglePresentationMode(); | 372 void TogglePresentationMode(); |
| 376 #endif | 373 #endif |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 int index) OVERRIDE; | 494 int index) OVERRIDE; |
| 498 virtual void TabStripEmpty() OVERRIDE; | 495 virtual void TabStripEmpty() OVERRIDE; |
| 499 | 496 |
| 500 // Overridden from content::WebContentsDelegate: | 497 // Overridden from content::WebContentsDelegate: |
| 501 virtual bool PreHandleKeyboardEvent( | 498 virtual bool PreHandleKeyboardEvent( |
| 502 const content::NativeWebKeyboardEvent& event, | 499 const content::NativeWebKeyboardEvent& event, |
| 503 bool* is_keyboard_shortcut) OVERRIDE; | 500 bool* is_keyboard_shortcut) OVERRIDE; |
| 504 virtual void HandleKeyboardEvent( | 501 virtual void HandleKeyboardEvent( |
| 505 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 502 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
| 506 | 503 |
| 507 // Fullscreen permission infobar callbacks. | |
| 508 // TODO(koz): Remove this and have callers call FullscreenController directly. | |
| 509 void OnAcceptFullscreenPermission(const GURL& url, | |
| 510 FullscreenExitBubbleType bubble_type); | |
| 511 void OnDenyFullscreenPermission(FullscreenExitBubbleType bubble_type); | |
| 512 | |
| 513 // Figure out if there are tabs that have beforeunload handlers. | 504 // Figure out if there are tabs that have beforeunload handlers. |
| 514 bool TabsNeedBeforeUnloadFired(); | 505 bool TabsNeedBeforeUnloadFired(); |
| 515 | 506 |
| 516 bool is_type_tabbed() const { return type_ == TYPE_TABBED; } | 507 bool is_type_tabbed() const { return type_ == TYPE_TABBED; } |
| 517 bool is_type_popup() const { return type_ == TYPE_POPUP; } | 508 bool is_type_popup() const { return type_ == TYPE_POPUP; } |
| 518 bool is_type_panel() const { return type_ == TYPE_PANEL; } | 509 bool is_type_panel() const { return type_ == TYPE_PANEL; } |
| 519 | 510 |
| 520 bool is_app() const; | 511 bool is_app() const; |
| 521 bool is_devtools() const; | 512 bool is_devtools() const; |
| 522 | 513 |
| 523 // See FullscreenController::IsFullscreenForTabOrPending. | |
| 524 bool IsFullscreenForTabOrPending() const; | |
| 525 | |
| 526 // True when the mouse cursor is locked. | 514 // True when the mouse cursor is locked. |
| 527 bool IsMouseLocked() const; | 515 bool IsMouseLocked() const; |
| 528 | 516 |
| 529 // Called each time the browser window is shown. | 517 // Called each time the browser window is shown. |
| 530 void OnWindowDidShow(); | 518 void OnWindowDidShow(); |
| 531 | 519 |
| 532 // Show the first run search engine bubble on the location bar. | 520 // Show the first run search engine bubble on the location bar. |
| 533 void ShowFirstRunBubble(); | 521 void ShowFirstRunBubble(); |
| 534 | 522 |
| 535 void set_pending_web_app_action(WebAppAction action) { | 523 void set_pending_web_app_action(WebAppAction action) { |
| 536 pending_web_app_action_ = action; | 524 pending_web_app_action_ = action; |
| 537 } | 525 } |
| 538 | 526 |
| 527 FullscreenController* fullscreen_controller() { |
| 528 return fullscreen_controller_.get(); |
| 529 } |
| 530 |
| 539 ExtensionWindowController* extension_window_controller() const { | 531 ExtensionWindowController* extension_window_controller() const { |
| 540 return extension_window_controller_.get(); | 532 return extension_window_controller_.get(); |
| 541 } | 533 } |
| 542 | 534 |
| 543 protected: | 535 protected: |
| 544 // Funnel for the factory method in BrowserWindow. This allows subclasses to | 536 // Funnel for the factory method in BrowserWindow. This allows subclasses to |
| 545 // set their own window. | 537 // set their own window. |
| 546 virtual BrowserWindow* CreateBrowserWindow(); | 538 virtual BrowserWindow* CreateBrowserWindow(); |
| 547 | 539 |
| 548 private: | 540 private: |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 bool window_has_shown_; | 1040 bool window_has_shown_; |
| 1049 | 1041 |
| 1050 // Currently open color chooser. Non-NULL after OpenColorChooser is called and | 1042 // Currently open color chooser. Non-NULL after OpenColorChooser is called and |
| 1051 // before DidEndColorChooser is called. | 1043 // before DidEndColorChooser is called. |
| 1052 scoped_ptr<content::ColorChooser> color_chooser_; | 1044 scoped_ptr<content::ColorChooser> color_chooser_; |
| 1053 | 1045 |
| 1054 DISALLOW_COPY_AND_ASSIGN(Browser); | 1046 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 1055 }; | 1047 }; |
| 1056 | 1048 |
| 1057 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1049 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |