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 #include "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 wm_type != ui::WM_ICE_WM && | 499 wm_type != ui::WM_ICE_WM && |
500 wm_type != ui::WM_KWIN && | 500 wm_type != ui::WM_KWIN && |
501 wm_type != ui::WM_METACITY && | 501 wm_type != ui::WM_METACITY && |
502 wm_type != ui::WM_MUTTER) { | 502 wm_type != ui::WM_MUTTER) { |
503 type = TYPE_POPUP; | 503 type = TYPE_POPUP; |
504 } | 504 } |
505 } | 505 } |
506 #endif // TOOLKIT_GTK | 506 #endif // TOOLKIT_GTK |
507 #endif // !OS_CHROMEOS || USE_AURA | 507 #endif // !OS_CHROMEOS || USE_AURA |
508 | 508 |
| 509 #if defined(USE_AURA) |
| 510 type = TYPE_APP; |
| 511 #endif |
| 512 |
509 CreateParams params(type, profile); | 513 CreateParams params(type, profile); |
510 params.app_name = app_name; | 514 params.app_name = app_name; |
511 params.initial_bounds = window_bounds; | 515 params.initial_bounds = window_bounds; |
512 return CreateWithParams(params); | 516 return CreateWithParams(params); |
513 } | 517 } |
514 | 518 |
515 // static | 519 // static |
516 Browser* Browser::CreateForDevTools(Profile* profile) { | 520 Browser* Browser::CreateForDevTools(Profile* profile) { |
517 #if defined(OS_CHROMEOS) | 521 #if defined(OS_CHROMEOS) |
518 CreateParams params(TYPE_TABBED, profile); | 522 CreateParams params(TYPE_TABBED, profile); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 find_bar_controller_->find_bar()->MoveWindowIfNecessary(gfx::Rect(), true); | 588 find_bar_controller_->find_bar()->MoveWindowIfNecessary(gfx::Rect(), true); |
585 } | 589 } |
586 return find_bar_controller_.get(); | 590 return find_bar_controller_.get(); |
587 } | 591 } |
588 | 592 |
589 bool Browser::HasFindBarController() const { | 593 bool Browser::HasFindBarController() const { |
590 return find_bar_controller_.get() != NULL; | 594 return find_bar_controller_.get() != NULL; |
591 } | 595 } |
592 | 596 |
593 bool Browser::is_app() const { | 597 bool Browser::is_app() const { |
594 return !app_name_.empty(); | 598 return type_ == TYPE_APP || !app_name_.empty(); |
595 } | 599 } |
596 | 600 |
597 bool Browser::is_devtools() const { | 601 bool Browser::is_devtools() const { |
598 return app_name_ == DevToolsWindow::kDevToolsApp; | 602 return app_name_ == DevToolsWindow::kDevToolsApp; |
599 } | 603 } |
600 | 604 |
601 /////////////////////////////////////////////////////////////////////////////// | 605 /////////////////////////////////////////////////////////////////////////////// |
602 // Browser, Creation Helpers: | 606 // Browser, Creation Helpers: |
603 | 607 |
604 // static | 608 // static |
(...skipping 4901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5506 profile()->GetOriginalProfile()); | 5510 profile()->GetOriginalProfile()); |
5507 if (service->HasSyncSetupCompleted()) | 5511 if (service->HasSyncSetupCompleted()) |
5508 ShowOptionsTab(chrome::kPersonalOptionsSubPage); | 5512 ShowOptionsTab(chrome::kPersonalOptionsSubPage); |
5509 else | 5513 else |
5510 service->ShowLoginDialog(); | 5514 service->ShowLoginDialog(); |
5511 } | 5515 } |
5512 | 5516 |
5513 void Browser::ToggleSpeechInput() { | 5517 void Browser::ToggleSpeechInput() { |
5514 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5518 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
5515 } | 5519 } |
OLD | NEW |