| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/go_button.h" | 5 #include "chrome/browser/views/go_button.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" |
| 7 #include "chrome/app/chrome_dll_resource.h" | 8 #include "chrome/app/chrome_dll_resource.h" |
| 8 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/views/event_utils.h" | 10 #include "chrome/browser/views/event_utils.h" |
| 10 #include "chrome/browser/views/location_bar_view.h" | 11 #include "chrome/browser/views/location_bar_view.h" |
| 11 #include "chrome/common/l10n_util.h" | 12 #include "chrome/common/l10n_util.h" |
| 12 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
| 13 | 14 |
| 14 //////////////////////////////////////////////////////////////////////////////// | 15 //////////////////////////////////////////////////////////////////////////////// |
| 15 // GoButton, public: | 16 // GoButton, public: |
| 16 | 17 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 91 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 91 stop_timer_.NewRunnableMethod(&GoButton::OnButtonTimer), | 92 stop_timer_.NewRunnableMethod(&GoButton::OnButtonTimer), |
| 92 button_delay_); | 93 button_delay_); |
| 93 } | 94 } |
| 94 } | 95 } |
| 95 | 96 |
| 96 //////////////////////////////////////////////////////////////////////////////// | 97 //////////////////////////////////////////////////////////////////////////////// |
| 97 // GoButton, View overrides: | 98 // GoButton, View overrides: |
| 98 | 99 |
| 99 void GoButton::OnMouseExited(const views::MouseEvent& e) { | 100 void GoButton::OnMouseExited(const views::MouseEvent& e) { |
| 100 using namespace views; | |
| 101 | |
| 102 if (visible_mode_ != intended_mode_) | 101 if (visible_mode_ != intended_mode_) |
| 103 ChangeMode(intended_mode_); | 102 ChangeMode(intended_mode_); |
| 104 | 103 |
| 105 if (state() != BS_DISABLED) | 104 if (state() != BS_DISABLED) |
| 106 SetState(BS_NORMAL); | 105 SetState(BS_NORMAL); |
| 107 } | 106 } |
| 108 | 107 |
| 109 bool GoButton::GetTooltipText(int x, int y, std::wstring* tooltip) { | 108 bool GoButton::GetTooltipText(int x, int y, std::wstring* tooltip) { |
| 110 if (visible_mode_ == MODE_STOP) { | 109 if (visible_mode_ == MODE_STOP) { |
| 111 tooltip->assign(l10n_util::GetString(IDS_TOOLTIP_STOP)); | 110 tooltip->assign(l10n_util::GetString(IDS_TOOLTIP_STOP)); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 139 | 138 |
| 140 //////////////////////////////////////////////////////////////////////////////// | 139 //////////////////////////////////////////////////////////////////////////////// |
| 141 // GoButton, private: | 140 // GoButton, private: |
| 142 | 141 |
| 143 void GoButton::OnButtonTimer() { | 142 void GoButton::OnButtonTimer() { |
| 144 if (intended_mode_ != visible_mode_) | 143 if (intended_mode_ != visible_mode_) |
| 145 ChangeMode(intended_mode_); | 144 ChangeMode(intended_mode_); |
| 146 | 145 |
| 147 stop_timer_.RevokeAll(); | 146 stop_timer_.RevokeAll(); |
| 148 } | 147 } |
| OLD | NEW |