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/views/frame/browser_frame_win.h" | 5 #include "chrome/browser/ui/views/frame/browser_frame_win.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "base/win/metro.h" | 13 #include "base/win/metro.h" |
14 #include "chrome/app/chrome_command_ids.h" | 14 #include "chrome/app/chrome_command_ids.h" |
15 #include "chrome/browser/lifetime/application_lifetime.h" | 15 #include "chrome/browser/lifetime/application_lifetime.h" |
16 #include "chrome/browser/search_engines/template_url.h" | 16 #include "chrome/browser/search_engines/template_url.h" |
17 #include "chrome/browser/search_engines/template_url_service.h" | 17 #include "chrome/browser/search_engines/template_url_service.h" |
18 #include "chrome/browser/search_engines/template_url_service_factory.h" | 18 #include "chrome/browser/search_engines/template_url_service_factory.h" |
19 #include "chrome/browser/ui/browser_commands.h" | 19 #include "chrome/browser/ui/browser_commands.h" |
| 20 #include "chrome/browser/ui/browser_tabstrip.h" |
20 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" | 21 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
21 #include "chrome/browser/ui/views/frame/browser_view.h" | 22 #include "chrome/browser/ui/views/frame/browser_view.h" |
22 #include "chrome/browser/ui/views/frame/system_menu_model.h" | 23 #include "chrome/browser/ui/views/frame/system_menu_model.h" |
23 #include "chrome/browser/ui/views/frame/system_menu_model_delegate.h" | 24 #include "chrome/browser/ui/views/frame/system_menu_model_delegate.h" |
24 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 25 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
25 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
26 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
27 #include "content/public/browser/browser_accessibility_state.h" | 28 #include "content/public/browser/browser_accessibility_state.h" |
28 #include "content/public/browser/page_navigator.h" | 29 #include "content/public/browser/page_navigator.h" |
29 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 reinterpret_cast<base::win::CurrentTabInfo*>(w_param); | 526 reinterpret_cast<base::win::CurrentTabInfo*>(w_param); |
526 | 527 |
527 Browser* browser = browser_view()->browser(); | 528 Browser* browser = browser_view()->browser(); |
528 DCHECK(browser); | 529 DCHECK(browser); |
529 | 530 |
530 // We allocate memory for the title and url via LocalAlloc. The caller has to | 531 // We allocate memory for the title and url via LocalAlloc. The caller has to |
531 // free the memory via LocalFree. | 532 // free the memory via LocalFree. |
532 current_tab_info->title = base::win::LocalAllocAndCopyString( | 533 current_tab_info->title = base::win::LocalAllocAndCopyString( |
533 browser->GetWindowTitleForCurrentTab()); | 534 browser->GetWindowTitleForCurrentTab()); |
534 | 535 |
535 WebContents* current_tab = browser->GetActiveWebContents(); | 536 WebContents* current_tab = chrome::GetActiveWebContents(browser); |
536 DCHECK(current_tab); | 537 DCHECK(current_tab); |
537 | 538 |
538 current_tab_info->url = base::win::LocalAllocAndCopyString( | 539 current_tab_info->url = base::win::LocalAllocAndCopyString( |
539 UTF8ToWide(current_tab->GetURL().spec())); | 540 UTF8ToWide(current_tab->GetURL().spec())); |
540 } | 541 } |
541 | 542 |
542 void BrowserFrameWin::CacheMinimizeButtonDelta() { | 543 void BrowserFrameWin::CacheMinimizeButtonDelta() { |
543 int minimize_offset = GetMinimizeButtonOffsetForWindow(GetNativeView()); | 544 int minimize_offset = GetMinimizeButtonOffsetForWindow(GetNativeView()); |
544 if (!minimize_offset) | 545 if (!minimize_offset) |
545 return; | 546 return; |
(...skipping 23 matching lines...) Expand all Loading... |
569 | 570 |
570 //////////////////////////////////////////////////////////////////////////////// | 571 //////////////////////////////////////////////////////////////////////////////// |
571 // NativeBrowserFrame, public: | 572 // NativeBrowserFrame, public: |
572 | 573 |
573 // static | 574 // static |
574 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( | 575 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( |
575 BrowserFrame* browser_frame, | 576 BrowserFrame* browser_frame, |
576 BrowserView* browser_view) { | 577 BrowserView* browser_view) { |
577 return new BrowserFrameWin(browser_frame, browser_view); | 578 return new BrowserFrameWin(browser_frame, browser_view); |
578 } | 579 } |
OLD | NEW |